You are here

function panels_common_get_layout_information in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/common.inc \panels_common_get_layout_information()

The layout information fieldset displayed at admin/edit/panel-%implementation%/add/%layout%.

File

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

Code

function panels_common_get_layout_information($panel_implementation, $contexts = array()) {
  $form = array();
  panels_load_include('plugins');
  $layout = panels_get_layout($panel_implementation->display->layout);
  $form = array(
    '#type' => 'fieldset',
    '#title' => t('Layout'),
  );
  $form['layout-icon'] = array(
    '#value' => panels_print_layout_icon($panel_implementation->display->layout, $layout),
  );
  $form['layout-display'] = array(
    '#value' => check_plain($layout['title']),
  );
  $content = '<dl class="content-list">';
  foreach (panels_get_panels($layout, $panel_implementation->display) as $panel_id => $title) {
    $content .= "<dt>{$title}</dt><dd>";
    if ($panel_implementation->display->panels[$panel_id]) {
      $content .= '<ol>';
      foreach ($panel_implementation->display->panels[$panel_id] as $pid) {
        $content .= '<li>' . panels_get_pane_title($panel_implementation->display->content[$pid], $contexts) . '</li>';
      }
      $content .= '</ol>';
    }
    else {
      $content .= t('Empty');
    }
    $content .= '</dd>';
  }
  $content .= '</dl>';
  $form['layout-content'] = array(
    '#value' => $content,
  );
  return $form;
}