' . t('About') . ''; $output .= '

' . t('The Diff module replaces the normal Revisions node tab and enhances the listing of revisions with an option to view the differences between any two content revisions.') . '

'; $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Compare content entity revisions') . '
'; $output .= '
' . t('Diff provides the possibility of comparing two node revisions but it also provides support for comparing any two content entities. With minimum effort it can be extended to display differences between any two content entities.') . '
'; $output .= '
' . t('Control field visibility settings') . '
'; $output .= '
' . t('Fields visibility can be controlled from view modes for configurable fields and from Diff settings page for entity base fields. Diff field types specific settings can also be configured from Diff settings page') . '
'; $output .= '
' . t('Configure diff field type settings') . '
'; $output .= '
' . t('Every field type has specific diff settings (display or not the field title, markdown format or other settings). These settings can be configured from Diff settings page') . '
'; $output .= '
'; return $output; case 'diff.general_settings': return '

' . t('Configurations for the revision comparison functionality and diff layout plugins.') . '

'; case 'diff.revision_overview': return '

' . t('Revisions allow you to track differences between multiple versions of your content, and revert to older versions.') . '

'; case 'diff.fields_list': return '

' . t('This table provides a summary of the field support found on the system. For every field, a diff plugin can be selected and configured. These settings are applied to Unified and Split fields layouts.') . '

'; } } /** * Returns the label of a certain field. * * Therefore it looks up in all bundles to find the most used field. * * @param string $entity_type * The entity type id. * @param string $field_name * The field name. * * @return array * Array of labels used for the field sorted by the most used. */ function _diff_field_label($entity_type, $field_name) { $labels = []; // Count the amount of instances of each label per field storage. $bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type); $field_manager = \Drupal::service('entity_field.manager'); foreach (array_keys($bundles) as $bundle) { $bundle_instances = $field_manager->getFieldDefinitions($entity_type, $bundle); if (isset($bundle_instances[$field_name])) { $instance = $bundle_instances[$field_name]; $label = (string) $instance->getLabel(); $labels[$label] = isset($labels[$label]) ? ++$labels[$label] : 1; } } if (empty($labels)) { // Return the original field name if there is no other label found. return [$field_name]; } // Return the labels sorted by the most used. arsort($labels); return array_keys($labels); }