Project

General

Profile

Paste
Statistics
| Branch: | Revision:

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

Name Size Revision Age Author Comment
README.txt 3.33 KB 5a7e6170 about 10 years Florent Torregrosa Update : - panels : 7.x-3.3 -> 7.x-3.4 - pd...
i18n_panels.i18n.inc 1.15 KB 64156087 about 7 years Assos Assos Weekly update of contrib modules
i18n_panels.info 386 Bytes c06bd9a4 almost 4 years Assos Assos Weekly update of contrib modules
i18n_panels.install 763 Bytes 5a7e6170 about 10 years Florent Torregrosa Update : - panels : 7.x-3.3 -> 7.x-3.4 - pd...
i18n_panels.module 16.1 KB c06bd9a4 almost 4 years Assos Assos Weekly update of contrib modules

Latest revisions

# Date Author Comment
c06bd9a4 07/08/2020 11:11 PM Assos Assos

Weekly update of contrib modules

64156087 02/08/2017 11:59 PM Assos Assos

Weekly update of contrib modules

08475715 10/19/2016 10:49 PM Assos Assos

Weekly update of contrib modules

2545992a 08/24/2016 10:49 PM Assos Assos

Weekly update of contrib modules

136a805a 08/17/2016 10:51 PM Assos Assos

Weekly update of contrib modules

e4c061ad 01/28/2015 11:00 PM Assos Assos

Weekly update of contrib modules

5a7e6170 02/22/2014 07:53 PM Florent Torregrosa

Update :

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

View revisions

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']),
);
}

Also available in: Atom