Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / panels / i18n_panels @ e4c061ad

Nom Taille Révision Âge Auteur Commentaire
README.txt 3,33 ko 5a7e6170 environ 10 ans Florent Torregrosa Update : - panels : 7.x-3.3 -> 7.x-3.4 - pd...
i18n_panels.i18n.inc 1,15 ko 5a7e6170 environ 10 ans Florent Torregrosa Update : - panels : 7.x-3.3 -> 7.x-3.4 - pd...
i18n_panels.info 386 octets e4c061ad plus de 9 ans Assos Assos Weekly update of contrib modules
i18n_panels.install 763 octets 5a7e6170 environ 10 ans Florent Torregrosa Update : - panels : 7.x-3.3 -> 7.x-3.4 - pd...
i18n_panels.module 14,4 ko 5a7e6170 environ 10 ans Florent Torregrosa Update : - panels : 7.x-3.3 -> 7.x-3.4 - pd...

Dernières révisions

# Date Auteur Commentaire
e4c061ad 28/01/2015 23:00 Assos Assos

Weekly update of contrib modules

5a7e6170 22/02/2014 19:53 Florent Torregrosa

Update :

  • panels : 7.x-3.3 -> 7.x-3.4
  • pdf_reader : 7.x-1.0-rc4 -> 7.x-1.0-rc5

Voir les révisions

README


This module provides by default the ability to translate panel display and
panel pane titles.
Further it introduced an extension to the ctools content_types plugin.
You can now define translatable settings which will be registered in i18n.
Out of the box the module extends the custom content content_type to allow
translation of the content.

Requirements:
Ctools 7.x-1.x-dev (Jan 28-2014 or newer)
Panels 7.x-3.x-dev (Jan 28-2014 or newer)

Plugin definition extension:

This example shows how the content_type custom is extended:

Default:

/**

  • Plugins are described by creating a $plugin array which will be used
  • by the system that includes this file. */ $plugin = array( 'title' => t('Custom content'), 'no title override' => TRUE, 'defaults' => array('admin_title' => '', 'title' => '', 'body' => '', 'format' => filter_fallback_format(), 'substitute' => TRUE), 'js' => array('misc/autocomplete.js', 'misc/textarea.js', 'misc/collapse.js'), // Make sure the edit form is only used for some subtypes. 'edit form' => '', 'add form' => '', 'edit text' => t('Edit'), 'all contexts' => TRUE, );

Extended Configuration:

/**

  • Plugins are described by creating a $plugin array which will be used
  • by the system that includes this file. */ $plugin = array( 'title' => t('Custom content'), 'no title override' => TRUE, 'defaults' => array('admin_title' => '', 'title' => '', 'body' => '', 'format' => filter_fallback_format(), 'substitute' => TRUE), 'js' => array('misc/autocomplete.js', 'misc/textarea.js', 'misc/collapse.js'), // Make sure the edit form is only used for some subtypes. 'edit form' => '', 'add form' => '', 'edit text' => t('Edit'), 'all contexts' => TRUE, 'i18n_settings' = array( 'title', 'body' => array('format' => 'plain_text'), 'items|0|title' ), );

The new key "i18n_settings" defines an array with the settings that are
translatable. The array contains the names of the settings, they have to be
available in the "defaults" array of the content definition. If you need to
define a format use the name of the setting as the array item key and as item
another array with the detail configuration. E.g
'i18n_settings' = array('body' => array('format' => 'plain_text'))

If i18n_settings is a string it's used as callback. The expected return is an
array equal to the one used in the fix configuration.
You can even declare nested settings as translatable, to do so use '|' as
delimiter.
E.g. 'items|0|title' is evaluated as $settings['items'][0]['title']

Callback:

/**

  • Plugins are described by creating a $plugin array which will be used
  • by the system that includes this file. */ $plugin = array( 'title' => t('Custom content'), 'no title override' => TRUE, 'defaults' => array('admin_title' => '', 'title' => '', 'body' => '', 'format' => filter_fallback_format(), 'substitute' => TRUE), 'js' => array('misc/autocomplete.js', 'misc/textarea.js', 'misc/collapse.js'), // Make sure the edit form is only used for some subtypes. 'edit form' => '', 'add form' => '', 'edit text' => t('Edit'), 'all contexts' => TRUE, 'i18n_settings' => 'ctools_custom_content_type_i18n_settings', );

function ctools_custom_content_type_i18n_settings($conf) {
return array(
'title',
'body' => array('format' => $conf['format']),
);
}

Formats disponibles : Atom