function ad_admin_group_form in Advertisement 7
Same name and namespace in other branches
- 5.2 ad.module \ad_admin_group_form()
- 5 ad.module \ad_admin_group_form()
- 6.3 ad.admin.inc \ad_admin_group_form()
- 6 ad.admin.inc \ad_admin_group_form()
- 6.2 ad.admin.inc \ad_admin_group_form()
Returns a form for adding an ad group.
File
- ./
ad.admin.inc, line 773 - Advertisement admin pages and functions.
Code
function ad_admin_group_form($form_state, $group = NULL) {
$group = $group['build_info']['args'][0];
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Group name'),
'#default_value' => isset($group->name) ? check_plain($group->name) : '',
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t('Specify a name for the ad group.'),
);
$form['description'] = array(
'#type' => 'textarea',
'#title' => t('Description'),
'#default_value' => isset($group->description) ? check_plain($group->description) : '',
'#required' => TRUE,
'#description' => t('Describe this ad group.'),
);
$form['weight'] = array(
'#type' => 'weight',
'#title' => t('Weight'),
'#default_value' => isset($group->weight) ? $group->weight : 0,
'#description' => t('When listing ad groups, those with lighter (smaller) weights get listed before ad groups with heavier (larger) weights. Ad groups with equal weights are sorted alphabetically.'),
);
$form['vid'] = array(
'#type' => 'hidden',
'#value' => _ad_get_vid(),
);
if (isset($group->tid)) {
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
$form['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete'),
);
$form['tid'] = array(
'#type' => 'value',
'#value' => $group->tid,
);
}
else {
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Create group'),
);
}
return $form;
}