You are here

function panels_mini_panels_mini_content_type_admin_info in Panels 7.3

Callback to provide administrative info. Provide links to edit the mini panel.

File

panels_mini/plugins/content_types/panels_mini.inc, line 158
Contains the content type plugin for a mini panel. While this does not need to be broken out into a .inc file, it's convenient that we do so that we don't load code unnecessarily. Plus it demonstrates plugins in modules other than Panels itself.

Code

function panels_mini_panels_mini_content_type_admin_info($subtype, $conf) {
  $mini = panels_mini_load($subtype);
  if (!$mini) {
    return FALSE;
  }
  $block = new stdClass();
  $block->title = $mini->admin_title;
  $admin_pages = array(
    t('Settings') => 'basic',
    t('Context') => 'context',
    t('Layout') => 'layout',
    t('Content') => 'content',
  );
  $links = array();
  foreach ($admin_pages as $title => $tail) {
    $links[] = l($title, 'admin/structure/mini-panels/list/' . $subtype . '/edit/' . $tail, array(
      'query' => drupal_get_destination(),
    ));
  }
  $block->content = theme('item_list', array(
    'items' => $links,
  ));
  return $block;
}