function ctools_export_ui::import_page in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 plugins/export_ui/ctools_export_ui.class.php \ctools_export_ui::import_page()
Page callback to import information for an exportable item.
File
- plugins/
export_ui/ ctools_export_ui.class.php, line 1190
Class
- ctools_export_ui
- Base class for export UI.
Code
function import_page($js, $input, $step = NULL) {
drupal_set_title($this
->get_page_title('import'));
// Import is basically a multi step wizard form, so let's go ahead and
// use CTools' wizard.inc for it.
// If a step not set, they are trying to create a new item. If a step
// is set, they're in the process of creating an item.
if (!empty($step)) {
$item = $this
->edit_cache_get(NULL, 'import');
}
if (empty($item)) {
$item = ctools_export_crud_new($this->plugin['schema']);
}
$form_state = array(
'plugin' => $this->plugin,
'object' => &$this,
'ajax' => $js,
'item' => $item,
'op' => 'add',
'form type' => 'import',
'rerender' => TRUE,
'no_redirect' => TRUE,
'step' => $step,
// Store these in case additional args are needed.
'function args' => func_get_args(),
);
// import always uses the wizard.
$output = $this
->edit_execute_form_wizard($form_state);
if (!empty($form_state['executed'])) {
$export_key = $this->plugin['export']['key'];
drupal_goto(str_replace('%ctools_export_ui', $form_state['item']->{$export_key}, $this->plugin['redirect']['add']));
}
return $output;
}