public function backup_migrate_location::edit_form in Backup and Migrate 7.3
Same name and namespace in other branches
- 8.3 includes/locations.inc \backup_migrate_location::edit_form()
- 6.3 includes/locations.inc \backup_migrate_location::edit_form()
Get the edit form for the item.
Overrides backup_migrate_item::edit_form
4 calls to backup_migrate_location::edit_form()
- backup_migrate_destination::edit_form in includes/
destinations.inc - Get the edit form for the item.
- backup_migrate_destination_filesource::edit_form in includes/
sources.filesource.inc - Gets the form for the settings for the files destination.
- backup_migrate_location_remote::edit_form in includes/
locations.inc - Location configuration callback.
- backup_migrate_source_remote::edit_form in includes/
sources.inc - Source configuration callback.
4 methods override backup_migrate_location::edit_form()
- backup_migrate_destination::edit_form in includes/
destinations.inc - Get the edit form for the item.
- backup_migrate_destination_filesource::edit_form in includes/
sources.filesource.inc - Gets the form for the settings for the files destination.
- backup_migrate_location_remote::edit_form in includes/
locations.inc - Location configuration callback.
- backup_migrate_source_remote::edit_form in includes/
sources.inc - Source configuration callback.
File
- includes/
locations.inc, line 193
Class
- backup_migrate_location
- A base class for creating locations.
Code
public function edit_form() {
if (!empty($this->supported_ops)) {
$form = parent::edit_form();
$form['subtype'] = array(
"#type" => "value",
"#default_value" => $this
->get('subtype'),
);
}
else {
$types = $this
->location_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 . "/settings/{$this->type_name}/add/{$type_url_str}", array(
'attributes' => array(
'title' => t('Add a new @s location.', 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 location you would like to create:') . '<dl>' . implode('', $items) . '</dl>';
}
else {
$output = t('No types available.');
}
$form['select_type'] = array(
'#type' => 'markup',
'#markup' => $output,
);
}
return $form;
}