You are here

function fieldable_panels_panes_entity_make_current_page in Fieldable Panels Panes (FPP) 7

Callback to make a revision current.

This is an operation only and has no output; it is assumed a destination will be provided, though it will go ahead and redirect you to the view of the entity.

It is token protected.

Parameters

object $entity: The FPP object to process.

1 string reference to 'fieldable_panels_panes_entity_make_current_page'
fieldable_panels_panes_menu in ./fieldable_panels_panes.module
Implements hook_menu().

File

includes/admin.inc, line 275
Contains administrative pages and functions for fieldable entity panes.

Code

function fieldable_panels_panes_entity_make_current_page($entity) {
  if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], $entity->fpid . ':' . $entity->vid)) {
    return MENU_ACCESS_DENIED;
  }

  // Since this was loaded with a different revision, a simple save will make
  // that current without creating a new revision or disturbing the 'current'
  // revision.
  fieldable_panels_panes_save($entity);
  drupal_set_message(t('The revision has been made current.'));
  drupal_goto("admin/structure/fieldable-panels-panes/view/{$entity->fpid}");
}