You are here

function _panelizer_generate_quickedit_viewmode in Quick Edit 7

Helper function to transform the "panelizer view mode" into a "Quick Edit view mode ID", to make Edit use Panelizer's render pipeline to re-render fields after they've been edited.

See also

panelizer_quickedit_render_field()

2 calls to _panelizer_generate_quickedit_viewmode()
quickedit_preprocess_field in ./quickedit.module
Implements hook_preprocess_field().
quickedit_preprocess_panelizer_view_mode in includes/panelizer.inc
Implements hook_preprocess_panelizer_view_mode().

File

includes/panelizer.inc, line 86
Implements Quick Edit module hooks on behalf of panelizer.module.

Code

function _panelizer_generate_quickedit_viewmode($entity) {

  // Ensure Panelizer view mode property exists.
  if (!isset($entity->panelizer_view_mode)) {
    return '0';
  }

  // @see includes/panelizer.inc/panelizer_panelizer_pre_render_alter()
  $key = $entity->panelizer_view_mode;
  $panelizer_entity = $entity->panelizer[$key];
  return implode('-', array(
    'panelizer',
    $panelizer_entity->view_mode,
  ));
}