You are here

function uc_stock_settings_form in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_stock/uc_stock.module \uc_stock_settings_form()
  2. 6.2 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, &$form_state) {
  $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.'),
    '#rows' => 10,
  );
  if (module_exists('token')) {
    $form['token_tree'] = array(
      '#markup' => theme('token_tree', array(
        'token_types' => array(
          'uc_order',
          'uc_stock',
          'node',
          'site',
          'store',
        ),
      )),
    );
  }
  return system_settings_form($form);
}