You are here

function title_ctools_context_converter_alter in Title 7

Implements hook_ctools_context_converter_alter().

File

./title.module, line 1028

Code

function title_ctools_context_converter_alter($context, $converter, &$value, &$converter_options) {

  // This is a temporary fix for https://www.drupal.org/node/2505311.
  // It fixes a language issue for the pane title containing entity
  // related keywords.
  if (isset($context->type[0]) && 0 === strpos($context->type[0], 'entity:') && empty($converter_options['language'])) {
    $plugin = ctools_get_context($context->plugin);
    if ($function = ctools_plugin_get_function($plugin, 'convert')) {

      // Provide "language" option for converter and perform the conversion
      // again.
      $converter_options['language'] = $GLOBALS[LANGUAGE_TYPE_CONTENT];
      $value = $function($context, $converter, $converter_options);
    }
  }
}