function alinks_edit_form in Alinks 6
Same name and namespace in other branches
- 7 alinks.module \alinks_edit_form()
Generate the form used to edit alinks
2 string references to 'alinks_edit_form'
- alinks_menu in ./
alinks.module - Implementation of hook_menu().
- alinks_page in ./
alinks.module - Generate the page that will render the forms for adding and editing Alinks
File
- ./
alinks.module, line 345
Code
function alinks_edit_form() {
$form['alinks_edit_form'] = array(
'#type' => 'fieldset',
'#title' => t('Edit alinks'),
'#description' => t('Use this form to edit alinks. If you want to delete an entry, just select the corresponding checkbox. To edit the entry, edit the desired text. Click update to confirm any changes.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$sql = db_query("SELECT * FROM {alinks} ORDER BY alink_weight, alink_text");
if (count(db_fetch_array($sql)) > 0) {
$sql = db_query("SELECT * FROM {alinks} ORDER BY alink_weight, alink_text");
$form['alinks_edit_form']['edit_alink'] = array(
'#tree' => TRUE,
);
while ($alink = db_fetch_array($sql)) {
$alinks[$alink['id']] = $alink;
$form['alinks_edit_form']['edit_alink'][$alink['id']]['start_boundary_edit'] = array(
'#type' => 'checkbox',
'#default_value' => $alink['alink_start_boundary'],
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['word_edit'] = array(
'#type' => 'textfield',
'#size' => 10,
'#maxlength' => 255,
'#default_value' => $alink['alink_text'],
'#required' => TRUE,
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['end_boundary_edit'] = array(
'#type' => 'checkbox',
'#default_value' => $alink['alink_end_boundary'],
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['case_insensitive_edit'] = array(
'#type' => 'checkbox',
'#default_value' => $alink['alink_case_insensitive'],
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['url_edit'] = array(
'#type' => 'textfield',
'#size' => 30,
'#maxlength' => 255,
'#default_value' => $alink['alink_url'],
'#required' => TRUE,
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['url_title_edit'] = array(
'#type' => 'textfield',
'#size' => 30,
'#maxlength' => 255,
'#default_value' => $alink['url_title'],
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['external_edit'] = array(
'#type' => 'checkbox',
'#default_value' => $alink['alink_external'],
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['class_edit'] = array(
'#type' => 'textfield',
'#size' => 30,
'#maxlength' => 255,
'#default_value' => $alink['alink_class'],
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['weight_edit'] = array(
'#type' => 'weight',
'#default_value' => $alink['alink_weight'],
);
$form['alinks_edit_form']['edit_alink'][$alink['id']]['delete'] = array(
'#type' => 'checkbox',
);
}
$form['alinks_edit_form']['save_edit'] = array(
'#type' => 'submit',
'#value' => t('Update alinks'),
);
$form['alinks_edit_form']['alinks'] = array(
'#type' => 'value',
'#value' => $alinks,
);
$form['alinks_edit_form']['#theme'] = 'alinks_list';
}
return $form;
}