You are here

function i18n_ctools_render_alter in Panels 7.3

Implements hook_ctools_render_alter().

Under some circumstances the title of the panel page is set before hook_panels_pre_render() is fired. Such cases can be handled with this hook.

@todo Check if a drupal_alter() in panels_display::get_title() is applicable.

File

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

Code

function i18n_ctools_render_alter(&$info, $page, $context) {

  // @todo Find a better way to detect a panels page.
  if ($page === TRUE && !empty($info['content']['#display']) && $info['content']['#display'] instanceof panels_display) {
    i18n_panels_panels_pre_render($info['content']['#display'], NULL);

    // Set the info title. This is used to set the page title.
    $info['title'] = $info['content']['#display']
      ->get_title();
  }
}