You are here

function uc_stock_settings_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_stock/uc_stock.module \uc_stock_settings_form()
  2. 7.3 uc_stock/uc_stock.admin.inc \uc_stock_settings_form()

Form builder for stock settings form.

1 string reference to 'uc_stock_settings_form'
uc_stock_menu in uc_stock/uc_stock.module
Implements hook_menu().

File

uc_stock/uc_stock.admin.inc, line 13
Stock administration menu items.

Code

function uc_stock_settings_form() {
  $form['uc_stock_threshold_notification'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send email notification when stock level reaches its threshold value'),
    '#default_value' => variable_get('uc_stock_threshold_notification', FALSE),
  );
  $form['uc_stock_threshold_notification_recipients'] = array(
    '#type' => 'textfield',
    '#title' => t('Notification recipients'),
    '#default_value' => variable_get('uc_stock_threshold_notification_recipients', uc_store_email()),
    '#description' => t('The list of comma separated email addresses that will receive the notification.'),
  );
  $form['uc_stock_threshold_notification_subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Message subject'),
    '#default_value' => variable_get('uc_stock_threshold_notification_subject', uc_get_message('uc_stock_threshold_notification_subject')),
  );
  $form['uc_stock_threshold_notification_message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message text'),
    '#default_value' => variable_get('uc_stock_threshold_notification_message', uc_get_message('uc_stock_threshold_notification_message')),
    '#description' => t('The message the user receives when the stock level reaches its threshold value (uses <a href="!token-help-page">global, order, product and stock tokens</a>).', array(
      '!token-help-page' => url('admin/store/help/tokens'),
    )),
    '#rows' => 10,
  );
  return system_settings_form($form);
}