You are here

function panels_tabs_panels_pane_content_alter in Panels Tabs 7.2

Same name and namespace in other branches
  1. 6 panels_tabs.module \panels_tabs_panels_pane_content_alter()
  2. 7 panels_tabs.module \panels_tabs_panels_pane_content_alter()

Implements hook_panels_pane_content_alter().

Hold the title of the pane for later use (i.e. show it as the tab's title), and remove it form the pane itself.

File

./panels_tabs.module, line 23
Show panel panes in a region as tabs.

Code

function panels_tabs_panels_pane_content_alter(&$content, $pane, $args, $context, $renderer, $display) {

  // Get the regions that should be themed as tabs.
  foreach ($display->panel_settings as $key => $values) {
    if ($key == 'style_settings') {
      continue;
    }
    if (is_array($values) && !empty($values['style']) && $values['style'] == 'tabs' && $pane->panel == $key || $key === 'style' && $values === 'tabs') {
      if (!empty($content->title)) {

        // Capture the title.
        panels_tabs_pane_titles($display->did, $pane->pid, $content->title);

        // Remove it form the pane.
        $content->title = '';
      }
    }
  }
}