public function backup_migrate_item::edit_form in Backup and Migrate 7.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.3 includes/crud.inc \backup_migrate_item::edit_form()
- 6.2 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 778 - 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.
Code
public 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' => 'machine_name',
'#default_value' => $this
->get_id(),
'#maxlength' => 255,
'#machine_name' => array(
'source' => array(
'name',
),
'exists' => 'backup_migrate_crud_item_exists',
),
);
$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),
)),
);
$form['actions']['cancel'] = array(
'#value' => l(t('Cancel'), $this
->get_settings_path()),
);
return $form;
}