You are here

function theme_panels_common_content_list in Panels 7.3

Same name and namespace in other branches
  1. 5.2 includes/common.inc \theme_panels_common_content_list()
  2. 6.3 includes/common.inc \theme_panels_common_content_list()
  3. 6.2 includes/common.inc \theme_panels_common_content_list()

Create a visible list of content in a display. Note that the contexts must be pre-loaded.

File

includes/common.inc, line 525
Functions used by more than one panels client module.

Code

function theme_panels_common_content_list($vars) {
  $display = $vars['display'];
  $layout = panels_get_layout($display->layout);
  $content = '<dl class="content-list">';
  foreach (panels_get_regions($layout, $display) as $panel_id => $title) {
    $content .= "<dt>{$title}</dt><dd>";
    if (!empty($display->panels[$panel_id])) {
      $content .= '<ol>';
      foreach ($display->panels[$panel_id] as $pid) {
        $content .= '<li>' . panels_get_pane_title($display->content[$pid], $display->context) . '</li>';
      }
      $content .= '</ol>';
    }
    else {
      $content .= t('Empty');
    }
    $content .= '</dd>';
  }
  $content .= '</dl>';
  return $content;
}