You are here

function uc_textfield in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \uc_textfield()
  2. 7.3 uc_store/uc_store.module \uc_textfield()

A simple Forms API textfield generator...

12 calls to uc_textfield()
uc_cart_pane_quotes in shipping/uc_quote/uc_quote.module
Cart pane callback.
uc_checkout_pane_billing in uc_cart/uc_cart_checkout_pane.inc
Gets the billing information.
uc_checkout_pane_customer in uc_cart/uc_cart_checkout_pane.inc
Gets the user's email address for login.
uc_checkout_pane_delivery in uc_cart/uc_cart_checkout_pane.inc
Gets the delivery information.
uc_order_pane_bill_to in uc_order/uc_order.order_pane.inc
Handles the "Bill to" order pane.

... See full list

File

uc_store/uc_store.module, line 1250
Contains global Ubercart functions and store administration functionality.

Code

function uc_textfield($title, $default = NULL, $required = TRUE, $description = NULL, $maxlength = 32, $size = 32) {
  if (is_null($title) || empty($title)) {
    return NULL;
  }
  $textfield = array(
    '#type' => 'textfield',
    '#title' => $title,
    '#description' => $description,
    '#size' => $size,
    '#maxlength' => $maxlength,
    '#required' => $required,
    '#default_value' => $default,
    '#summary' => $default ? t('@title is %default.', array(
      '@title' => $title,
      '%default' => $default,
    )) : t('@title is not set.', array(
      '@title' => $title,
    )),
  );
  return $textfield;
}