You are here

function i18n_panels_get_i18n_settings in Panels 7.3

Fetch the i18n_settings of the content type if there are any.

Parameters

stdClass $pane: The pane to deal with.

Return value

array|false Settings or FALSE if none are present.

1 call to i18n_panels_get_i18n_settings()
i18n_panels_get_i18n_translation_object in i18n_panels/i18n_panels.module
Returns the translation object of the pane.

File

i18n_panels/i18n_panels.module, line 17
Internationalization (i18n) submodule: Panels translation.

Code

function i18n_panels_get_i18n_settings($pane) {
  ctools_include('content');
  $content_type = ctools_get_content_type($pane->type);
  if (isset($content_type['i18n_settings'])) {
    if (is_string($content_type['i18n_settings']) && function_exists($content_type['i18n_settings'])) {
      $content_type['i18n_settings'] = $content_type['i18n_settings']($pane->configuration);
    }
  }

  // Provide the override title string as translation for all panes that have
  // this setting enabled.
  if (isset($pane->configuration['override_title']) && $pane->configuration['override_title']) {
    if (isset($content_type['i18n_settings']) && is_array($content_type['i18n_settings'])) {
      $content_type['i18n_settings'][] = 'override_title_text';
    }
    else {
      $content_type['i18n_settings'] = array(
        'override_title_text',
      );
    }
  }
  return isset($content_type['i18n_settings']) ? $content_type['i18n_settings'] : FALSE;
}