You are here

function total_control_add_views_pane_display in Total Control Admin Dashboard 6.2

Same name and namespace in other branches
  1. 7.2 includes/total_control.inc \total_control_add_views_pane_display()

Adds a pane display to the view

Parameters

$view: The view to which the display is added

$machine_type: The machine-readable content type name

$content_type: The human-readable content type name

2 calls to total_control_add_views_pane_display()
total_control_admin_settings_submit in ./total_control.admin.inc
Submit function for settings page
total_control_views_add_display in includes/total_control.inc
Adds view displays.

File

includes/total_control.inc, line 136
total_control.inc

Code

function total_control_add_views_pane_display(&$view, $content_type, $machine_type) {

  // Build the display.
  $handler = $view
    ->new_display('panel_pane', $content_type . ' pane', 'panel_pane_tc_' . $machine_type);
  $handler
    ->override_option('filters', array(
    'type' => array(
      'operator' => 'in',
      'value' => array(
        $machine_type => $machine_type,
      ),
      'group' => '0',
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'id' => 'type',
      'table' => 'node',
      'field' => 'type',
      'override' => array(
        'button' => 'Use default',
      ),
      'relationship' => 'none',
    ),
  ));
  $handler
    ->override_option('title', 'New ' . $content_type);
  $handler
    ->override_option('pane_title', 'New ' . $content_type . ' content');
  $handler
    ->override_option('pane_description', 'Total Control ' . $content_type . ' summary');
  $handler
    ->override_option('pane_category', array(
    'name' => 'Total Control',
    'weight' => '0',
  ));
  $handler
    ->override_option('allow', array(
    'use_pager' => FALSE,
    'items_per_page' => 'items_per_page',
    'offset' => FALSE,
    'link_to_view' => FALSE,
    'more_link' => FALSE,
    'path_override' => FALSE,
    'title_override' => FALSE,
    'exposed_form' => FALSE,
  ));
  $handler
    ->override_option('argument_input', array());
  $handler
    ->override_option('link_to_view', 0);
  $handler
    ->override_option('inherit_panels_path', 0);

  // save the view and return
  $view
    ->save();
  return;
}