Commit 5df9a296 authored by Arnaud Bour's avatar Arnaud Bour

Bug fixes

parent 9fd93932
......@@ -164,7 +164,7 @@ Drupal.ephotoDamField.prototype = {
const fields = this._getFields();
for (const inc in fields) {
if (typeof versions[fields[inc].name] === 'undefined') {
if (!fields[inc].name.length || typeof versions[fields[inc].name] === 'undefined') {
fields[inc].input.val('');
fields[inc].caption.val('');
fields[inc].thumbnail.val('');
......
......@@ -20,50 +20,49 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* )
*/
class EphotoDamFieldFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
/**
* Constructs a new instance of the plugin.
*
* @param string $plugin_id
* The plugin_id for the formatter.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The definition of the field to which the formatter is associated.
* @param array $settings
* The formatter settings.
* @param string $label
* The formatter label display setting.
* @param string $view_mode
* The view mode.
* @param array $third_party_settings
* Third party settings.
*/
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, $settings, $label, $view_mode, $third_party_settings) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
}
/**
* Constructs a new instance of the plugin.
*
* @param string $plugin_id
* The plugin_id for the formatter.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The definition of the field to which the formatter is associated.
* @param array $settings
* The formatter settings.
* @param string $label
* The formatter label display setting.
* @param string $view_mode
* The view mode.
* @param array $third_party_settings
* Third party settings.
*/
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, $settings, $label, $view_mode, $third_party_settings) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$plugin_id,
$plugin_definition,
$configuration['field_definition'],
$configuration['settings'],
$configuration['label'],
$configuration['view_mode'],
$configuration['third_party_settings']
);
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$plugin_id,
$plugin_definition,
$configuration['field_definition'],
$configuration['settings'],
$configuration['label'],
$configuration['view_mode'],
$configuration['third_party_settings']
);
}
/**
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
$element = [];
/**
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
$element = [];
return $element;
}
return $element;
}
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ class EphotoDamFieldWidget extends WidgetBase {
$version_support = $this->getFieldSetting('version_support');
$field_name = $this->fieldDefinition->getName();
if (!isset(self::$_first[$field_name])) {
if (empty(self::$_first[$field_name])) {
$classes = ['button', 'ephoto-dam-field-button', 'ephoto-dam-field-versions-button'];
if (!$version_support) $classes[] = 'ephoto-dam-field-hidden';
......@@ -147,8 +147,9 @@ class EphotoDamFieldWidget extends WidgetBase {
'onclick' => 'EphotoDamField[\'' . $field_name . '\'].selectFile(' . $delta . ');return false'
]
];
if (!$is_default_values_form && (!$version_support || !self::$_first)) {
// self::$_first[$field_name]
if (!$is_default_values_form && (!$version_support || !empty(self::$_first[$field_name]))) {
$prefix_classes = ['ephoto-dam-field-thumbnail-image'];
if ($version_support) $prefix_classes[] = 'ephoto-dam-field-hidden';
......
msgid ""
msgstr ""
"Project-Id-Version: Ephoto Dam Addon For Drupal\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: ePhoto Dam Team <support@ephoto.fr>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"X-Generator: Poedit 2.2.4\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid "Ephoto Dam help"
msgstr "Aide Ephoto Dam"
msgid "Select a file from Ephoto Dam"
msgstr "Select un fichier depuis Ephoto Dam"
msgid "Activate the use of the Ephoto Dam filter"
msgstr "Activer l'utilisation du filtre Ephoto Dam"
msgid "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>."
msgstr "Pour intégrer les champs Ephoto Dam, assurez-vous que vous avez activé le filtre et fait glisser l'icône dans la barre d'outils WYSIWYG. Pour plus d'informations, <a href=\"@url\"> lire la documentation</a>."
msgid "Server URL"
msgstr "URL du serveur"
msgid "Captions"
msgstr "Légendes"
msgid "Captions format"
msgstr "Format des légendes"
msgid "Zoom"
msgstr "Zoom"
msgid "Images size"
msgstr "Taille des images"
msgid "Videos size"
msgstr "Taille des vidéos"
msgid "Documents size"
msgstr "Taille des documents"
msgid "Please enter the URL of your Ephoto Dam software"
msgstr "Veuillez entrer l'URL de votre logiciel Ephoto Dam"
msgid "Display the caption under images, videos and documents"
msgstr "Afficher la légende sous les images, vidéos et documents"
msgid "View large images by clicking on them"
msgstr "Afficher les images en grand en cliquant dessus"
msgid "Please enter the size of the images for the display"
msgstr "Veuillez saisir la taille des images à l'affichage"
msgid "Please enter the size of the videos for the display"
msgstr "Veuillez saisir la taille des vidéos à l'affichage"
msgid "Please enter the size of the documents for the display"
msgstr "Veuillez saisir la taille des documents à l'affichage"
msgid "https://ephoto.mycompany.com/"
msgstr "https://ephoto.masociete.fr/"
msgid "Error loading the Ephoto Dam API"
msgstr "Erreur lors du chargement de l'API Ephoto Dam"
msgid "Please enter a correct URL"
msgstr "Veuillez saisir une URL correcte"
msgid "Enter the caption here"
msgstr "Saisir la légende ici"
msgid "Properties"
msgstr "Propriétés"
msgid "Alternative text"
msgstr "Texte alternatif"
msgid "Align"
msgstr "Aligner"
msgid "None"
msgstr "Aucun"
msgid "Left"
msgstr "Gauche"
msgid "Center"
msgstr "Centre"
msgid "Right"
msgstr "Droit"
msgid "Caption"
msgstr "Légende"
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