You are here

public function PanelizerEntityDefault::has_default_panel in Panelizer 7.3

Same name and namespace in other branches
  1. 7.2 plugins/entity/PanelizerEntityDefault.class.php \PanelizerEntityDefault::has_default_panel()

Determine if a bundle has a default display.

Parameters

$bundle: A $bundle.$view_mode combo string. If no view mode is specified then the 'page_manager' view mode will be assumed.

Overrides PanelizerEntityInterface::has_default_panel

2 calls to PanelizerEntityDefault::has_default_panel()
PanelizerEntityDefault::hook_entity_load in plugins/entity/PanelizerEntityDefault.class.php
PanelizerEntityDefault::page_settings in plugins/entity/PanelizerEntityDefault.class.php
Switched page callback to give the settings form.

File

plugins/entity/PanelizerEntityDefault.class.php, line 2748
Base class for the Panelizer Entity plugin.

Class

PanelizerEntityDefault
Base class for the Panelizer Entity plugin.

Code

public function has_default_panel($bundle) {
  if (strpos($bundle, '.') === FALSE) {
    $bundle .= '.page_manager';
  }
  list($bundle, $view_mode) = explode('.', $bundle);

  // Is this display panelized?
  $is_panelized = $this
    ->is_panelized($bundle);

  // Load the default setting name.
  $default = $this
    ->get_default_display_name($bundle, $view_mode);

  // Verify the display exists.
  $display_exists = $this
    ->default_display_exists($default);
  return $is_panelized && !empty($default) && $display_exists;
}