You are here

function subscriptions_settings_form in Subscriptions 7

Same name and namespace in other branches
  1. 5.2 subscriptions.admin.inc \subscriptions_settings_form()
  2. 6 subscriptions.admin.inc \subscriptions_settings_form()
  3. 2.0.x subscriptions.admin.old.php \subscriptions_settings_form()

Site Settings form at admin/settings/subscriptions.

Other submodules contribute additional parts to this form.

_state

Parameters

array $form:

Return value

array

1 string reference to 'subscriptions_settings_form'
subscriptions_menu in ./subscriptions.module
Implements hook_menu().

File

./subscriptions.admin.inc, line 18
Subscriptions module (load-on-demand admin functions).

Code

function subscriptions_settings_form(array $form, array &$form_state) {
  global $user;
  $form = array();
  $tr = 't';
  $form['links'] = array(
    '#type' => 'fieldset',
    '#title' => t('Links'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => -100,
  );
  $form['links'][] = array(
    '#markup' => '<div>' . l($tr('Permissions'), 'admin/people/permissions', array(
      'fragment' => 'module-subscriptions',
    )) . '</div>',
    '#weight' => -20,
  );
  if (module_exists('subscriptions_mail')) {
    $form['links'][] = array(
      '#markup' => '<div>' . l($tr('Mail templates'), 'admin/config/system/mail-edit') . '</div>',
      '#weight' => -10,
    );
  }
  $form['links'][] = array(
    '#markup' => '<div>' . l(t('Bulk subscribing/unsubscribing'), 'admin/people') . '</div>',
    '#weight' => 0,
  );
  $form['links'][] = array(
    '#markup' => '<div>' . l(t('Run cron manually!'), 'admin/reports/status/run-cron') . '</div>',
    '#weight' => 0,
  );
  $form['links'][] = array(
    '#markup' => '<div>' . l(t('My subscriptions'), 'user/' . $user->uid . '/subscriptions') . '</div>',
    '#weight' => 10,
  );

  //$form['sub_settings'] = array(

  //    '#type' => 'fieldset',
  //    '#title' => t('General settings'),
  //    '#weight' => -3,

  //);

  //$form['sub_settings']['subscriptions_testpost'] = array(

  //  '#type'          => 'checkbox',
  //  '#title'         => t('Test held posts prior to sending'),
  //  '#default_value' => variable_get('subscriptions_testpost', 0),
  //  '#description'   => t('Tests to see if a post about to be sent by cron is still active.  Adds a small amount of overhead.  Default is OFF.'),

  //);

  //$form['sub_settings']['subscriptions_link_teaser'] = array(

  //  '#type'          => 'checkbox',
  //  '#title'         => t('Show subscribe link with teaser'),
  //  '#default_value' => variable_get('subscriptions_link_teaser', 1),
  //  '#description'   => t('Uncheck to show link only in node view.'),

  //);
  if (variable_get('subscriptions_show_install_info', 1) && (!module_exists('subscriptions_ui') || !module_exists('subscriptions_mail') || !module_exists('subscriptions_content') || !module_exists('subscriptions_taxonomy'))) {
    if (empty($_POST)) {
      drupal_set_message(t('Note: For standard Subscriptions functionality you need to enable the following modules:') . '<ul><li>' . $tr('Subscriptions UI') . '</li><li>' . $tr('Subscriptions Mail ') . '</li><li>' . $tr('Content Subscriptions') . '</li><li>' . $tr('Taxonomy Subscriptions') . '</li></ul>', 'warning', FALSE);
    }
    $form['subscriptions_show_install_info'] = array(
      '#type' => 'checkbox',
      '#title' => t('Keep showing the installation reminder above.'),
      '#default_value' => variable_get('subscriptions_show_install_info', 1),
      '#description' => t('Uncheck this box to permanently remove the reminder, if you have a reason for not enabling the standard selection of Subscriptions modules.'),
      '#weight' => -101,
    );
  }
  return system_settings_form($form);
}