rendered paste bodyfunction corkboard_edit($imageid = 0)
{
if($imageid != 0)
{
$result = db_query("SELECT filename,xpos,ypos,enabled,link FROM {corkboard} WHERE id=%s",$imageid);
$row = db_fetch_array($result);
$form['corkboard']['filename'] = array(
'#type' => 'item',
'#title' => t('Filename'),
'#value' => $row['filename']
);
$form['corkboard']['xpos'] = array(
'#type' => 'textfield',
'#title' => t('X Position'),
'#default_value' => $row['xpos'],
'#maxlength' => 4,
'#required' => TRUE
);
$form['corkboard']['ypos'] = array(
'#type' => 'textfield',
'#title' => t('Y Position'),
'#default_value' => $row['ypos'],
'#maxlength' => 4,
'#required' => TRUE
);
$form['corkboard']['enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enabled?'),
'#default_value' => $row['enabled'],
);
$form['corkboard']['link'] = array(
'#type' => 'textfield',
'#title' => t('Link'),
'#default_value' => $row['link'],
'#maxlength' => 256
);
$form['corkboard']['submit'] = array('#type' => 'submit', '#value' => t('Save'));
$form['corkboard']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'));
drupal_get_form($form);
}else{
drupal_set_message('Cannot edit image.', 'error');
}
}