You are here

function view_custom_table_add_custom_table_to_view_form in Views Custom Table 7

Form to add custom table in table information table.

1 string reference to 'view_custom_table_add_custom_table_to_view_form'
view_custom_table_menu in ./view_custom_table.module
Implements hook_menu().

File

./view_custom_table.admin.inc, line 11
File for administrative functions.

Code

function view_custom_table_add_custom_table_to_view_form($form, &$form_state) {
  if (!empty($form_state['page_num']) && $form_state['page_num'] == 2) {
    return view_custom_table_add_custom_table_column_relationship_form($form, $form_state);
  }

  // Display table name form if not set yet.
  $form_state['page_num'] = 1;
  $form['table_name'] = array(
    '#title' => t('Table Name'),
    '#type' => 'textfield',
    '#required' => TRUE,
    '#description' => t('Don not enter drupal core tables. it will create conflict.'),
  );
  $form['table_description'] = array(
    '#title' => t('Description'),
    '#type' => 'textarea',
    '#rows' => 5,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['next'] = array(
    '#type' => 'submit',
    '#value' => t('Next >>'),
    '#validate' => array(
      'view_custom_table_add_custom_table_to_view_form_validate',
    ),
    '#submit' => array(
      'view_custom_table_add_custom_table_to_view_form_submit',
    ),
  );
  $form['actions']['cancel'] = array(
    '#type' => 'markup',
    '#markup' => l(t('Cancel'), 'admin/structure/views/custom_table'),
  );
  return $form;
}