function backup_migrate_destination::edit_form

nittany7 destinations.inc backup_migrate_destination::edit_form()
mooc7 destinations.inc backup_migrate_destination::edit_form()

Get the edit form for the item.

Overrides backup_migrate_item::edit_form

4 calls to backup_migrate_destination::edit_form()
backup_migrate_destination_email::edit_form in modules/contrib/backup_migrate/includes/destinations.email.inc
Get the form for the settings for this filter.
backup_migrate_destination_files::edit_form in modules/contrib/backup_migrate/includes/destinations.file.inc
Get the form for the settings for the files destination.
backup_migrate_destination_nodesquirrel::edit_form in modules/contrib/backup_migrate/includes/destinations.nodesquirrel.inc
Get the form for the settings for this destination.
backup_migrate_destination_remote::edit_form in modules/contrib/backup_migrate/includes/destinations.inc
Destination configuration callback.
3 methods override backup_migrate_destination::edit_form()
backup_migrate_destination_files::edit_form in modules/contrib/backup_migrate/includes/destinations.file.inc
Get the form for the settings for the files destination.
backup_migrate_destination_nodesquirrel::edit_form in modules/contrib/backup_migrate/includes/destinations.nodesquirrel.inc
Get the form for the settings for this destination.
backup_migrate_destination_remote::edit_form in modules/contrib/backup_migrate/includes/destinations.inc
Destination configuration callback.

File

modules/contrib/backup_migrate/includes/destinations.inc, line 773
All of the destination handling code needed for Backup and Migrate.

Class

backup_migrate_destination
A base class for creating destinations.

Code

function edit_form() {
  if (get_class($this) !== 'backup_migrate_destination') {
    $form = parent::edit_form();
    $form['name'] = array(
      "#type" => "textfield",
      "#title" => t("Destination name"),
      "#default_value" => $this->get_name(),
      "#required" => TRUE,
    );
    $form['type'] = array(
      "#type" => "value",
      "#default_value" => $this->destination_type,
    );
  }
  else {
    $types = backup_migrate_get_destination_types();
    $items = array();
    // If no (valid) node type has been provided, display a node type overview.
    foreach ($types as $key => $type) {
      if (@$type['can_create']) {
        $type_url_str = str_replace('_', '-', $key);
        $out = '<dt>' . l($type['type_name'], BACKUP_MIGRATE_MENU_PATH . "/destination/list/add/$type_url_str", array('attributes' => array('title' => t('Add a new @s destination.', array('@s' => $type['type_name']))))) . '</dt>';
        $out .= '<dd>' . filter_xss_admin($type['description']) . '</dd>';
        $items[] = $out;
      }
    }
    if (count($items)) {
      $output = t('Choose the type of destination you would like to create:') . '<dl>' . implode('', $items) . '</dl>';
    }
    else {
      $output = t('No destination types available.');
    }
    $form['select_type'] = array(
      '#type' => 'markup',
      '#markup' => $output,
    );
  }
  return $form;
}