You are here

function panels_panel_node_view_title in Panels 6.2

Set up a title for the panel based upon the node types selected.

1 string reference to 'panels_panel_node_view_title'
panels_panel_node_view_delegator_task_handlers in plugins/task_handlers/panel_node_view.inc

File

plugins/task_handlers/panel_node_view.inc, line 168

Code

function panels_panel_node_view_title($handler, $task, $subtask_id) {
  $types = node_get_types();
  $names = array();
  foreach (array_filter($handler->conf['type']) as $type) {
    $names[] = check_plain($types[$type]->name);
  }
  if (empty($names)) {
    return t('Panel for all node types');
  }
  return format_plural(count($names), 'Panel for node type "@types"', 'Panel for node types "@types"', array(
    '@types' => implode(', ', $names),
  ));
}