function views_ui::clone_page

3.x views_ui.class.php views_ui::clone_page($js, $input, $item, $step = NULL)
1 call to views_ui::clone_page()

File

plugins/export_ui/views_ui.class.php, line 309
Contains the CTools Export UI integration code.

Class

views_ui
CTools Export UI class handler for Views UI.

Code

function clone_page($js, $input, $item, $step = NULL) {
  drupal_set_title($this->get_page_title('clone', $item));

  $name = $item->{$this->plugin['export']['key']};

  $form_state = array(
    'plugin' => $this->plugin,
    'object' => &$this,
    'ajax' => $js,
    'item' => $item,
    'op' => 'add',
    'form type' => 'clone',
    'original name' => $name,
    'rerender' => TRUE,
    'no_redirect' => TRUE,
    'step' => $step,
    // Store these in case additional args are needed.
    'function args' => func_get_args(),
  );

  $output = drupal_build_form('views_ui_clone_form', $form_state);
  if (!empty($form_state['executed'])) {
    $item->name = $form_state['values']['name'];
    $item->human_name = $form_state['values']['human_name'];
    $item->vid = NULL;
    views_ui_cache_set($item);

    drupal_goto(ctools_export_ui_plugin_menu_path($this->plugin, 'edit', $item->name));
  }

  return $output;
}