You are here

function shorten_cs_edit in Shorten URLs 7

Same name and namespace in other branches
  1. 8.2 modules/shorten_cs/shorten_cs.admin.inc \shorten_cs_edit()
  2. 8 modules/shorten_cs/shorten_cs.admin.inc \shorten_cs_edit()
  3. 6 shorten_cs.admin.inc \shorten_cs_edit()
  4. 7.2 shorten_cs.admin.inc \shorten_cs_edit()

Builds the form to edit a custom service.

1 string reference to 'shorten_cs_edit'
shorten_cs_edit_form in ./shorten_cs.admin.inc
Returns HTML representing the shorten service edit form.

File

./shorten_cs.admin.inc, line 138
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 (array(
    'name',
    'url',
    'type',
    'tag',
  ) as $key) {
    $form[$key]['#default_value'] = $service->{$key};
  }
  $form['sid'] = array(
    '#type' => 'value',
    '#value' => $service->sid,
  );
  $form['old_name'] = array(
    '#type' => 'value',
    '#value' => $service->name,
  );
  return $form;
}