You are here

function _subscriptions_taxonomy_form_subscriptions_settings_form_alter in Subscriptions 2.0.x

Same name and namespace in other branches
  1. 7 subscriptions_taxonomy.admin.inc \_subscriptions_taxonomy_form_subscriptions_settings_form_alter()

Implements hook_form_alter().

Adds the Taxonomy Settings part to SUBSCRIPTIONS_CONFIG_PATH.

_state

Parameters

array $form:

1 call to _subscriptions_taxonomy_form_subscriptions_settings_form_alter()
subscriptions_taxonomy_form_subscriptions_settings_form_alter in subscriptions_taxonomy/subscriptions_taxonomy.module
Implements hook_form_alter().

File

subscriptions_taxonomy/subscriptions_taxonomy.admin.inc, line 20
Subscriptions Content module (admin functions).

Code

function _subscriptions_taxonomy_form_subscriptions_settings_form_alter(array &$form, array &$form_state) {
  $tr = 't';
  $form['taxonomy'] = array(
    '#type' => 'fieldset',
    '#title' => t('Taxonomy settings'),
    '#collapsible' => TRUE,
    '#weight' => -8,
  );
  $vocabularies = taxonomy_get_vocabularies();
  $select[0] = '<' . t('none') . '>';
  foreach ($vocabularies as $vocabulary) {
    $select[$vocabulary->vid] = check_plain($vocabulary->name);
  }
  $form['taxonomy']['subscriptions_restricted_taxa'] = array(
    '#type' => 'select',
    '#title' => t('Restricted vocabularies'),
    '#default_value' => variable_get('subscriptions_restricted_taxa', array()),
    '#options' => $select,
    '#description' => t('Select vocabularies for which only the subscribed terms should be listed on the %Subscriptions | %Categories page.<br />This helps to reduce the size of the listing, especially for free-tagging vocabularies with large numbers of terms.', array(
      '%Subscriptions' => t('Subscriptions'),
      '%Categories' => $tr('Categories'),
    )),
    '#multiple' => TRUE,
  );
  $form['taxonomy']['subscriptions_omitted_taxa'] = array(
    '#type' => 'select',
    '#title' => t('Omitted vocabularies'),
    '#default_value' => variable_get('subscriptions_omitted_taxa', array()),
    '#options' => $select,
    '#description' => t('Select vocabularies which should be <strong>omitted</strong> from subscriptions listings; this means the terms of those vocabularies will be unlisted, i.e. they will be removed from subscription listings.<br />The content may still be available for subscribing via different kinds of subscriptions, but subscribing by category will be unavailable for the terms in the selected vocabularies.'),
    '#multiple' => TRUE,
  );

  // @ TODO write the code that supports this setting

  /*
  $form['taxonomy']['subscriptions_allow_vid'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow vocabularies subscription'),
    '#default_value' => variable_get('subscriptions_allow_vid', 1),
    '#description' => t('Allow users to subscribe to an entire vocabluary of terms.'),
  );
  */
}