You are here

function subscriptions_settings_form in Subscriptions 6

Same name and namespace in other branches
  1. 5.2 subscriptions.admin.inc \subscriptions_settings_form()
  2. 7 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.

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

File

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

Code

function subscriptions_settings_form(&$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(
    '#value' => '<div>' . l($tr('Permissions'), 'admin/user/permissions', array(
      'fragment' => 'module-subscriptions',
    )) . '</div>',
    '#weight' => -20,
  );
  if (module_exists('subscriptions_mail')) {
    if (module_exists('mail_edit')) {
      $form['links'][] = array(
        '#value' => '<div>' . l($tr('Mail templates'), 'admin/build/mail-edit') . '</div>',
        '#weight' => -10,
      );
    }
    else {
      $form['links'][] = array(
        '#value' => '<div>' . l('Mail Editor', 'http://drupal.org/project/mail_edit') . '</div>',
        '#weight' => -10,
      );
    }
  }
  $form['links'][] = array(
    '#value' => '<div>' . l(t('Run cron manually!'), 'admin/reports/status/run-cron') . '</div>',
    '#weight' => 0,
  );
  $form['links'][] = array(
    '#value' => '<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)) {
      include_once drupal_get_path('module', 'subscriptions') . '/subscriptions.install.inc';
      _subscriptions_install_information();
    }
    $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);
}