You are here

function fieldable_panels_panes_preprocess_panels_pane in Fieldable Panels Panes (FPP) 7

Add a class for our bundle to the normal panels pane theme.

File

./fieldable_panels_panes.module, line 933
Maintains an entity that appears as panel pane content.

Code

function fieldable_panels_panes_preprocess_panels_pane(&$vars) {
  if ($vars['pane']->type == 'fieldable_panels_pane') {
    if (!empty($vars['content']['#fieldable_panels_pane']) && is_object($vars['content']['#fieldable_panels_pane'])) {
      $entity = $vars['content']['#fieldable_panels_pane'];
      if (!empty($entity->link) && !empty($vars['title'])) {
        $vars['title'] = l($vars['title'], $entity->path, array(
          'html' => TRUE,
        ));
      }
      ctools_include('cleanstring');
      $vars['classes_array'][] = 'pane-bundle-' . ctools_cleanstring($entity->bundle, array(
        'lower case' => TRUE,
      ));

      // Add pane-fpid-[fpid] class when referenced by revision ID.
      if (strpos($vars['pane']->subtype, 'vid') === 0) {
        $vars['classes_array'][] = 'pane-fpid-' . $vars['content']['#fieldable_panels_pane']->fpid;
      }
    }
  }
}