function backup_migrate_item::edit_form in Backup and Migrate 6.3
Same name and namespace in other branches
- 8.2 includes/crud.inc \backup_migrate_item::edit_form()
- 8.3 includes/crud.inc \backup_migrate_item::edit_form()
- 6.2 includes/crud.inc \backup_migrate_item::edit_form()
- 7.3 includes/crud.inc \backup_migrate_item::edit_form()
- 7.2 includes/crud.inc \backup_migrate_item::edit_form()
Get the edit form for the item.
3 calls to backup_migrate_item::edit_form()
- backup_migrate_location::edit_form in includes/
locations.inc - Get the edit form for the item.
- backup_migrate_profile::edit_form in includes/
profiles.inc - Get the edit form.
- backup_migrate_schedule::edit_form in includes/
schedules.inc - Get the edit form.
3 methods override backup_migrate_item::edit_form()
- backup_migrate_location::edit_form in includes/
locations.inc - Get the edit form for the item.
- backup_migrate_profile::edit_form in includes/
profiles.inc - Get the edit form.
- backup_migrate_schedule::edit_form in includes/
schedules.inc - Get the edit form.
File
- includes/
crud.inc, line 776 - CRUD functions for backup and migrate types (schedules, profiles etc.).
Class
- backup_migrate_item
- A base class for items which can be stored in the database, listed, edited, deleted etc.
Code
function edit_form() {
$form = array();
$form['item'] = array(
'#type' => 'value',
'#value' => $this,
);
$name = $this
->get('name');
$form['name'] = array(
"#type" => "textfield",
"#title" => t("!type name", array(
'!type' => $this->title_singular,
)),
"#default_value" => empty($name) ? t('Untitled !type', array(
'!type' => $this->title_singular,
)) : $name,
"#required" => TRUE,
);
$form['id'] = array(
'#type' => 'value',
'#value' => $this
->get_id(),
);
$form['machine_name'] = array(
'#type' => 'value',
'#value' => $this
->get_id(),
);
$form['actions'] = array(
'#prefix' => '<div class="container-inline">',
'#suffix' => '</div>',
'#weight' => 99,
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save !type', array(
'!type' => t($this->singular),
)),
);
$cancel_url = isset($_GET['destination']) ? $_GET['destination'] : $this
->get_settings_path();
$form['actions']['cancel'] = array(
'#value' => l(t('Cancel'), $cancel_url),
);
return $form;
}