You are here

function uc_cart_links_settings_form in Ubercart 6.2

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

Define a form to configure the cart links settings.

1 string reference to 'uc_cart_links_settings_form'
uc_cart_links_menu in uc_cart_links/uc_cart_links.module
Implements hook_menu().

File

uc_cart_links/uc_cart_links.admin.inc, line 13
Cart links administration menu items.

Code

function uc_cart_links_settings_form() {
  $form = array();
  $form['instructions'] = array(
    '#value' => '<div>' . t('<a href="!url">View the help page</a> to learn how to create cart links.', array(
      '!url' => url('admin/store/help/cart_links'),
    )) . '</div>',
  );
  $form['uc_cart_links_add_show'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the cart link product action when you add a product to your cart.'),
    '#default_value' => variable_get('uc_cart_links_add_show', FALSE),
  );
  $form['uc_cart_links_track'] = array(
    '#type' => 'checkbox',
    '#title' => t('Track clicks through cart links that specify tracking IDs.'),
    '#default_value' => variable_get('uc_cart_links_track', TRUE),
  );
  $form['uc_cart_links_empty'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow cart links to empty customer carts.'),
    '#default_value' => variable_get('uc_cart_links_empty', TRUE),
  );
  $form['uc_cart_links_messages'] = array(
    '#type' => 'textarea',
    '#title' => t('Cart links messages'),
    '#description' => t('Enter messages available to the cart links API for display through a link. Separate messages with a line break. Each message should have a numeric key and text value, separated by "|". For example: 1337|Message text.'),
    '#default_value' => variable_get('uc_cart_links_messages', ''),
    '#wysiwyg' => FALSE,
  );
  $form['uc_cart_links_restrictions'] = array(
    '#type' => 'textarea',
    '#title' => t('Cart links restrictions'),
    '#description' => t('To restrict what cart links may be used on your site, enter all valid cart links in this textbox.  Separate links with a line break. Leave blank to permit any cart link.'),
    '#default_value' => variable_get('uc_cart_links_restrictions', ''),
    '#wysiwyg' => FALSE,
  );
  $form['uc_cart_links_invalid_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Invalid link redirect page'),
    '#description' => t('Enter the URL to redirect to when an invalid cart link is used.'),
    '#default_value' => variable_get('uc_cart_links_invalid_page', ''),
    '#size' => 32,
    '#field_prefix' => url(NULL, array(
      'absolute' => TRUE,
    )) . (variable_get('clean_url', 0) ? '' : '?q='),
  );
  return system_settings_form($form);
}