You are here

function uc_product_feature_form in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_product/uc_product.module \uc_product_feature_form()
  2. 7.3 uc_product/uc_product.module \uc_product_feature_form()

Returns a form array with some default hidden values and submit button.

Parameters

$form: The form array you wish to add the elements to.

Return value

The form array with elements added for the nid, pfid, submit button, and cancel link.

3 calls to uc_product_feature_form()
uc_file_feature_form in uc_file/uc_file.module
Form builder for hook_product_feature
uc_recurring_feature_form in payment/uc_recurring/uc_recurring.module
uc_roles_feature_form in uc_roles/uc_roles.module
Form builder for hook_product_feature

File

uc_product/uc_product.module, line 2783
The product module for Ubercart.

Code

function uc_product_feature_form($form) {
  if (!isset($form['nid'])) {
    $form['nid'] = array(
      '#type' => 'hidden',
      '#value' => intval(arg(1)),
    );
  }
  if (!isset($form['pfid'])) {
    $form['pfid'] = array(
      '#type' => 'hidden',
      '#value' => intval(arg(5)),
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save feature'),
  );
  $form['cancel'] = array(
    '#value' => l(t('Cancel'), 'node/' . intval(arg(1)) . '/edit/features'),
  );
  return $form;
}