You are here

public function fieldable_panels_pane::add_entity_page in Fieldable Panels Panes (FPP) 7

Add entity page.

File

plugins/export_ui/fieldable_panels_pane.class.php, line 128
Class for Export UI to manage Fieldable Panels Pane bundles.

Class

fieldable_panels_pane
Fieldable Panels Panes type Export UI plugin class.

Code

public function add_entity_page($js, $input, $item, $step = NULL) {
  $args = func_get_args();
  drupal_set_title($this
    ->get_page_title('add_entity', $item));
  $form_state = array(
    'entity' => fieldable_panels_panes_create(array(
      'bundle' => $item->name,
    )),
    'add submit' => TRUE,
    'plugin' => $this->plugin,
    'object' => &$this,
    'ajax' => $js,
    'item' => $item,
    'op' => 'add_entity',
    'no_redirect' => TRUE,
    'rerender' => TRUE,
    'step' => $step,
    'function args' => $args,
  );

  // Default these to reusable.
  $form_state['entity']->reusable = TRUE;
  $output = drupal_build_form('fieldable_panels_panes_entity_edit_form', $form_state);
  if (!empty($form_state['executed'])) {
    $this
      ->redirect($form_state['op'], $form_state['item']);
  }
  return $output;
}