updated i18n, views, imagestyleflush, field_group

patch views_rss_media
This commit is contained in:
2019-05-14 10:14:51 +02:00
parent 9adc940a67
commit c97e0f8ba1
142 changed files with 4489 additions and 786 deletions

View File

@@ -3,7 +3,7 @@ README.txt
==========
Drupal module: i18n_sync (Synchronization)
This module will handle content synchronization accross translations.
This module will handle content synchronization across translations.
The available list of fields to synchronize will include standard node fields and cck fields.
To have aditional fields, add the list in a variable in the settings.php file, like this:

View File

@@ -1,5 +1,5 @@
name = Synchronize translations
description = Synchronizes taxonomy and fields accross translations of the same content.
description = Synchronizes taxonomy and fields across translations of the same content.
dependencies[] = i18n
dependencies[] = translation
package = Multilingual - Internationalization
@@ -10,9 +10,8 @@ files[] = i18n_sync.install
files[] = i18n_sync.module.inc
files[] = i18n_sync.node.inc
files[] = i18n_sync.test
; Information added by Drupal.org packaging script on 2015-05-07
version = "7.x-1.13"
; Information added by Drupal.org packaging script on 2018-08-17
version = "7.x-1.26"
core = "7.x"
project = "i18n"
datestamp = "1430999922"
datestamp = "1534531985"

View File

@@ -33,7 +33,7 @@ function i18n_sync($status = NULL) {
function i18n_sync_help($path, $arg) {
switch ($path) {
case 'admin/help#i18n_sync' :
$output = '<p>' . t('This module synchronizes content taxonomy and fields accross translations:') . '</p>';
$output = '<p>' . t('This module synchronizes content taxonomy and fields across translations:') . '</p>';
$output .= '<p>' . t('First you need to select which fields should be synchronized. Then, after a node has been updated, all enabled vocabularies and fields will be synchronized as follows:') . '</p>';
$output .= '<ul>';
$output .= '<li>' . t('All the node fields selected for synchronization will be set to the same value for all translations.') . '</li>';
@@ -91,6 +91,7 @@ function i18n_sync_form_node_type_form_alter(&$form, &$form_state) {
$form['i18n_sync']['i18n_sync_node_type'] = array(
'#tree' => TRUE,
'#weight' => 1,
);
// Each set provides title and options. We build a big checkboxes control for it to be
@@ -121,6 +122,21 @@ function i18n_sync_form_node_type_form_alter(&$form, &$form_state) {
);
}
}
// Add option to restrict syncing only when editing the translation source.
$form['i18n_sync']['i18n_sync_source_description'] = array(
'#prefix' => '<div>', '#suffix' => '</div>',
'#markup' => t('Restrict synchronization to the translation source.'),
'#weight' => 2,
);
$form['i18n_sync']['i18n_sync_source'] = array(
'#type' => 'checkbox',
'#title' => t('Synchronize translations only when saving the translation source'),
'#default_value' => variable_get('i18n_sync_source_' . $type, FALSE),
'#disabled' => $disabled,
'#weight' => 3,
'#description' => t('If not checked each node will trigger the synchronization, whether it\'s the source or not.'),
);
}
}
@@ -167,9 +183,17 @@ function i18n_sync_node_insert($node) {
*/
function i18n_sync_node_update($node) {
// Let's go with field synchronization.
if (i18n_sync_node_check($node) && !empty($node->tnid) && ($fields = i18n_sync_node_fields($node->type)) && ($translations = i18n_sync_node_get_translations($node, TRUE))) {
module_load_include('node.inc', 'i18n_sync');
i18n_sync_node_translation($node, $translations, $fields, 'update');
if (i18n_sync_node_check($node) && !empty($node->tnid) && (!variable_get('i18n_sync_source_' . $node->type, TRUE) || $node->tnid == $node->nid) && ($fields = i18n_sync_node_fields($node->type)) && ($translations = i18n_sync_node_get_translations($node, TRUE))) {
$do_sync = TRUE;
if (module_exists('entity_translation')) {
if (entity_translation_enabled_bundle('node', $node->type)) {
$do_sync = FALSE;
}
}
if ($do_sync) {
module_load_include('node.inc', 'i18n_sync');
i18n_sync_node_translation($node, $translations, $fields, 'update');
}
}
}

View File

@@ -98,7 +98,7 @@ function i18n_sync_node_translation_nodereference_field(&$node, &$translation, $
* Example:
* English A references English B and English C.
* English A and B are translated to German A and B, but English C is not.
* The syncronization from English A to German A would it German B and English C.
* The synchronization from English A to German A would it German B and English C.
*/
function i18n_sync_node_translation_reference_field(&$reference_node, $default_value, $langcode) {
if (isset($reference_node->tnid) && translation_supported_type($reference_node->type)) {