You are here

interface PanelizerEntityInterface in Panelizer 7.3

Same name and namespace in other branches
  1. 7.2 plugins/entity/PanelizerEntityDefault.class.php \PanelizerEntityInterface

Interface to describe how PanelizerEntity plugin objects are implemented.

Hierarchy

Expanded class hierarchy of PanelizerEntityInterface

All classes that implement PanelizerEntityInterface

File

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

View source
interface PanelizerEntityInterface {

  /**
   * Initialize the plugin object.
   */
  public function init($plugin);

  // Public Drupal hooks
  public function hook_menu(&$items);
  public function hook_menu_alter(&$items);
  public function hook_form_alter(&$form, &$form_state, $form_id);
  public function hook_permission(&$items);
  public function hook_admin_paths(&$items);
  public function hook_views_data_alter(&$data);

  // Entity specific Drupal hooks
  public function hook_entity_load(&$entities);
  public function hook_entity_insert($entity);
  public function hook_entity_update($entity);
  public function hook_entity_delete($entity);
  public function hook_field_attach_delete_revision($entity);

  /**
   * Check if the necessary Page Manager display is enabled and the appropriate
   * variant has not been disabled.
   *
   * @return boolean
   *   Whether or not both the Page Manager display and the variant are enabled.
   */
  public function check_page_manager_status();

  /**
   * Add entity specific form to the Panelizer settings form.
   *
   * This is primarily to allow bundle selection per entity type.
   */
  public function settings_form(&$form, &$form_state);

  /**
   * Validate entity specific settings on the Panelizer settings form.
   */
  public function settings_form_validate(&$form, &$form_state);

  /**
   * Submit entity specific settings on the Panelizer settings form.
   */
  public function settings_form_submit(&$form, &$form_state);

  /**
   * Load the named default panel for the bundle.
   */
  public function get_default_panelizer_object($bundle, $name);

  /**
   * Determine if the current user has access to the $panelizer.
   */
  public function access_default_panelizer_object($panelizer);

  /**
   * Determine if a bundle is panelized
   */
  public function is_panelized($bundle);

  /**
   * Determine if a bundle has a defalt panel
   */
  public function has_default_panel($bundle);

  /**
   * Determine if a bundle is allowed choices.
   */
  public function has_panel_choice($bundle);

  /**
   * Determine the default name for the default object.
   */
  public function get_default_display_default_name($bundle, $view_mode = 'page_manager');

  /**
   * Determine the variable name used to identify the default display for the
   * given bundle/view mode combination.
   */
  public function get_default_display_variable_name($bundle, $view_mode = 'page_manager');

  /**
   * Determine the default display name for a given bundle & view mode
   * combination.
   */
  public function get_default_display_name($bundle, $view_mode = 'page_manager');

  /**
   * Determine whether a specific default display object exists.
   */
  public function default_display_exists($display_name);

  /**
   * Get a default display for a newly panelized entity.
   *
   * This is meant to give administrators a starting point when panelizing
   * new entities.
   */
  function get_default_display($bundle, $view_mode);

  /**
   * Identify the view modes that are available for use with this entity bundle.
   *
   * @param string $bundle
   *   The entity bundle to check. Defaults to '0', which will check for view
   *   modes that are available by default for all entities.
   *
   * @return array
   *   A list of view modes that are available to be panelized.
   */
  public function get_available_view_modes($bundle = 0);

  /**
   * Identify the view modes that are enabled for use with Panelizer.
   *
   * @param string $bundle
   *   The entity bundle to check.
   *
   * @return array
   *   A list of view modes that are panelized.
   */
  public function get_enabled_view_modes($bundle);

  /**
   * Get a panelizer object for the key.
   *
   * This must be implemented for each entity type, as the default object
   * implements a special case for handling panelizer defaults.
   */

  // @todo this seems to be unused now.
  //  function get_panelizer_object($key);

  /**
   * Render a panelized entity.
   */
  function render_entity($entity, $view_mode, $langcode = NULL, $args = array(), $address = NULL);

  /**
   * Fetch an object array of CTools contexts from panelizer information.
   */
  public function get_contexts($panelizer, $entity = NULL);

  /**
   * Callback to get the base context for a panelized entity
   */
  public function get_base_contexts($entity = NULL);

  /**
   * Confirm the view mode to be used, check if a substitute is assigned,
   * failover to 'default'.
   *
   * @param string $view_mode
   *   The original view mode to be checked.
   * @param string $bundle
   *   The entity bundle being used.
   *
   * @return string
   *   The final view mode that will be used.
   */
  public function get_view_mode($view_mode, $bundle);

  /**
   * Obtain the machine name of the Page Manager task.
   *
   * @return string
   *   The machine name for the Page Manager task; returns FALSE if this
   *   entity does not support Page Manager.
   */
  public function get_page_manager_task_name();

  /**
   * Identifies a substitute view mode for a given bundle.
   *
   * @param string $view_mode
   *   The original view mode to be checked.
   * @param string $bundle
   *   The entity bundle being checked.
   *
   * @return string
   *   The view mode that will be used.
   */
  public function get_substitute($view_mode, $bundle);

  /**
   * Obtain the system path to an entity bundle's display settings page for a
   * specific view mode.
   *
   * @param string $bundle
   * @param string $view_mode
   *
   * @return string
   *   The system path of the display settings page for this bundle/view mode
   *   combination.
   */
  public function admin_bundle_display_path($bundle, $view_mode);

  /**
   * Determine if the current user has $op access on the $entity.
   */
  public function entity_access($op, $entity);

  /**
   * Implement the save function for the entity.
   */
  public function entity_save($entity);

  /**
   * Determine if an entity allows revisions and whether or not the current
   * user has access to control that.
   *
   * @param $entity
   *   The entity in question.
   * @return
   *   An array. The first parameter is a boolean as to whether or not the
   *   entity supports revisions, the second parameter is whether or not the
   *   user can control if a revision is created, the third states whether or
   *   not the revision is created by default.
   */
  public function entity_allows_revisions($entity);

  /**
   * Get the visible identifier of the identity.
   *
   * This is overridable because it can be a bit awkward using the
   * default label.
   *
   * @return
   *   A translated, safe string.
   */
  public function entity_identifier($entity);

  /**
   * Get the name of bundles on the entity.
   *
   * Entity API doesn't give us a way to determine this, so the class must
   * do this.
   *
   * @return
   *   A translated, safe string.
   */
  public function entity_bundle_label();

  /**
   * Fetch the entity out of a build for hook_entity_view.
   *
   * @param $build
   *   The render array that contains the entity.
   */
  public function get_entity_view_entity($build);

  /**
   * Identify whether page manager is enabled for this entity type.
   *
   * @return bool
   */
  public function is_page_manager_enabled();

}

Members

Namesort descending Modifiers Type Description Overrides
PanelizerEntityInterface::access_default_panelizer_object public function Determine if the current user has access to the $panelizer. 1
PanelizerEntityInterface::admin_bundle_display_path public function Obtain the system path to an entity bundle's display settings page for a specific view mode. 1
PanelizerEntityInterface::check_page_manager_status public function Check if the necessary Page Manager display is enabled and the appropriate variant has not been disabled. 1
PanelizerEntityInterface::default_display_exists public function Determine whether a specific default display object exists. 1
PanelizerEntityInterface::entity_access public function Determine if the current user has $op access on the $entity. 4
PanelizerEntityInterface::entity_allows_revisions public function Determine if an entity allows revisions and whether or not the current user has access to control that. 1
PanelizerEntityInterface::entity_bundle_label public function Get the name of bundles on the entity. 1
PanelizerEntityInterface::entity_identifier public function Get the visible identifier of the identity. 1
PanelizerEntityInterface::entity_save public function Implement the save function for the entity. 4
PanelizerEntityInterface::get_available_view_modes public function Identify the view modes that are available for use with this entity bundle. 1
PanelizerEntityInterface::get_base_contexts public function Callback to get the base context for a panelized entity 1
PanelizerEntityInterface::get_contexts public function Fetch an object array of CTools contexts from panelizer information. 1
PanelizerEntityInterface::get_default_display function Get a default display for a newly panelized entity. 1
PanelizerEntityInterface::get_default_display_default_name public function Determine the default name for the default object. 1
PanelizerEntityInterface::get_default_display_name public function Determine the default display name for a given bundle & view mode combination. 1
PanelizerEntityInterface::get_default_display_variable_name public function Determine the variable name used to identify the default display for the given bundle/view mode combination. 1
PanelizerEntityInterface::get_default_panelizer_object public function Load the named default panel for the bundle. 1
PanelizerEntityInterface::get_enabled_view_modes public function Identify the view modes that are enabled for use with Panelizer. 1
PanelizerEntityInterface::get_entity_view_entity public function Fetch the entity out of a build for hook_entity_view. 1
PanelizerEntityInterface::get_page_manager_task_name public function Obtain the machine name of the Page Manager task. 1
PanelizerEntityInterface::get_substitute public function Identifies a substitute view mode for a given bundle. 1
PanelizerEntityInterface::get_view_mode public function Confirm the view mode to be used, check if a substitute is assigned, failover to 'default'. 1
PanelizerEntityInterface::has_default_panel public function Determine if a bundle has a defalt panel 1
PanelizerEntityInterface::has_panel_choice public function Determine if a bundle is allowed choices. 1
PanelizerEntityInterface::hook_admin_paths public function 1
PanelizerEntityInterface::hook_entity_delete public function 1
PanelizerEntityInterface::hook_entity_insert public function 1
PanelizerEntityInterface::hook_entity_load public function 1
PanelizerEntityInterface::hook_entity_update public function 1
PanelizerEntityInterface::hook_field_attach_delete_revision public function 1
PanelizerEntityInterface::hook_form_alter public function 1
PanelizerEntityInterface::hook_menu public function 1
PanelizerEntityInterface::hook_menu_alter public function 1
PanelizerEntityInterface::hook_permission public function 1
PanelizerEntityInterface::hook_views_data_alter public function 1
PanelizerEntityInterface::init public function Initialize the plugin object. 1
PanelizerEntityInterface::is_page_manager_enabled public function Identify whether page manager is enabled for this entity type. 1
PanelizerEntityInterface::is_panelized public function Determine if a bundle is panelized 1
PanelizerEntityInterface::render_entity function Render a panelized entity. 1
PanelizerEntityInterface::settings_form public function Add entity specific form to the Panelizer settings form. 1
PanelizerEntityInterface::settings_form_submit public function Submit entity specific settings on the Panelizer settings form. 1
PanelizerEntityInterface::settings_form_validate public function Validate entity specific settings on the Panelizer settings form. 1