You are here

function empty_page_callbacks_form in Empty Page 7

The Empty Page callback add / edit form.

Parameters

array $form_state:

int $cid:

Return value

array $form

1 string reference to 'empty_page_callbacks_form'
empty_page_menu in ./empty_page.module
Implements hook_menu().

File

./empty_page.admin.inc, line 115
Administrative functionality for Empty Page module.

Code

function empty_page_callbacks_form($form, &$form_state, $cid = NULL) {
  $callback = NULL;

  // If $cid exists, we're editing.
  if (isset($cid)) {
    $callback = empty_page_get_callback($cid);
  }
  if ($callback) {
    $form['empty_page_callback_cid'] = array(
      '#type' => 'hidden',
      '#value' => $callback->cid,
    );
    $form_title = t('Edit callback');
  }
  else {
    $form_title = t('Create a new callback');
  }
  $form['empty_page_basic'] = array(
    '#type' => 'fieldset',
    '#title' => $form_title,
    '#description' => '',
    '#collapsible' => TRUE,
  );
  $form['empty_page_basic']['empty_page_callback_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Internal path'),
    '#description' => '',
    '#required' => 1,
    '#default_value' => $callback ? $callback->path : '',
  );
  $form['empty_page_basic']['empty_page_callback_page_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Page title'),
    '#description' => '',
    '#default_value' => $callback ? $callback->page_title : '',
  );
  $form['empty_page_basic']['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => $callback ? t('Save') : t('Add'),
  );
  return $form;
}