function shorten_cs_edit in Shorten URLs 8.2
Same name and namespace in other branches
- 8 modules/shorten_cs/shorten_cs.admin.inc \shorten_cs_edit()
- 6 shorten_cs.admin.inc \shorten_cs_edit()
- 7.2 shorten_cs.admin.inc \shorten_cs_edit()
- 7 shorten_cs.admin.inc \shorten_cs_edit()
Builds the form to edit a custom service.
3 string references to 'shorten_cs_edit'
- CustomServicesEditForm::getFormId in modules/
shorten_cs/ src/ Form/ CustomServicesEditForm.php - Returns a unique string identifying the form.
- DefaultController::shortenCsEditForm in modules/
shorten_cs/ src/ Controller/ DefaultController.php - shortenCsEditForm in modules/
shorten_cs/ shorten_cs.admin.inc - Returns HTML representing the shorten service edit form.
File
- modules/
shorten_cs/ shorten_cs.admin.inc, line 27 - Provides the configuration page for Shorten URLs Custom Services.
Code
function shorten_cs_edit($form, &$form_state, $service) {
$form = shorten_cs_add_form($form, $form_state);
foreach ([
'name',
'url',
'type',
'tag',
] as $key) {
$form[$key]['#default_value'] = $service->{$key};
}
$form['sid'] = [
'#type' => 'value',
'#value' => $service->sid,
];
$form['old_name'] = [
'#type' => 'value',
'#value' => $service->name,
];
return $form;
}