You are here

function uc_catalog_admin_form in Ubercart 5

Catalog settings form.

Configure the display of the catalog breadcrumb.

1 string reference to 'uc_catalog_admin_form'
uc_catalog_admin_settings in uc_catalog/uc_catalog.module
Determines if the "Product Catalog" vocabulary has been set up.

File

uc_catalog/uc_catalog.module, line 1017
Übercart Catalog module.

Code

function uc_catalog_admin_form() {
  $form = array();
  $vocabs = array();
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $vid => $vocabulary) {
    $vocabs[$vid] = $vocabulary->name;
  }

  // JTR - catalog-top-level sub-textfield
  $form['catalog-top-level'] = array(
    '#type' => 'fieldset',
    '#title' => t('Catalog top level'),
    '#collapsible' => true,
    '#collapsed' => false,
    '#attributes' => array(
      'class' => 'catalog-top-level',
    ),
  );
  $form['catalog-top-level']['uc_catalog_vid'] = array(
    '#type' => 'select',
    '#title' => t('Catalog vocabulary'),
    '#description' => t("The taxonomy vocabulary that will be considered the product catalog."),
    '#default_value' => variable_get('uc_catalog_vid', 0),
    '#options' => $vocabs,
  );
  $form['catalog-top-level']['uc_catalog_breadcrumb'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the catalog breadcrumb'),
    '#default_value' => variable_get('uc_catalog_breadcrumb', true),
  );
  $form['catalog-top-level']['uc_catalog_breadcrumb_nodecount'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display node counts in the catalog breadcrumb'),
    '#default_value' => variable_get('uc_catalog_breadcrumb_nodecount', false),
  );
  $form['catalog-top-level']['uc_catalog_show_subcategories'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display subcategories in the catalog view'),
    '#default_value' => variable_get('uc_catalog_show_subcategories', true),
  );
  $form['catalog-top-level']['uc_catalog_category_columns'] = array(
    '#type' => 'select',
    '#title' => t('Number of columns in the grid of categories'),
    '#default_value' => variable_get('uc_catalog_category_columns', 3),
    '#options' => drupal_map_assoc(uc_range(1, 5)),
  );
  $form['block-display'] = array(
    '#type' => 'fieldset',
    '#title' => t('Catalog block settings'),
    '#collapsible' => true,
    '#collapsed' => false,
    '#attributes' => array(
      'class' => 'block-display',
    ),
  );
  $form['block-display']['uc_catalog_block_title'] = array(
    '#type' => 'checkbox',
    '#title' => t('Block title links to top level catalog page'),
    '#default_value' => variable_get('uc_catalog_block_title', true),
    '#description' => t("If selected, the block title is a link, otherwise plain text."),
  );
  $form['block-display']['uc_catalog_expand_categories'] = array(
    '#type' => 'checkbox',
    '#title' => t('Always expand categories in the catalog block'),
    '#default_value' => variable_get('uc_catalog_expand_categories', false),
  );
  $form['block-display']['uc_catalog_block_nodecount'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display node counts in the catalog block'),
    '#default_value' => variable_get('uc_catalog_block_nodecount', true),
  );
  $form['catalog-products-list'] = array(
    '#type' => 'fieldset',
    '#title' => t('Catalog products list'),
    '#collapsible' => true,
    '#collapsed' => false,
    '#attributes' => array(
      'class' => 'catalog-products-list',
    ),
  );
  $form['catalog-products-list']['uc_product_nodes_per_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Product nodes per page'),
    '#default_value' => variable_get('uc_product_nodes_per_page', 12),
    '#description' => t("Determines how many products will be listed on every catalog category. Notice that if you are using grid display it must be multiple of the grid width value, otherwise the last row will not match."),
    '#size' => 2,
  );
  return system_settings_form($form);
}