You are here

function shoutbox_admin_settings in Shoutbox 5

Same name and namespace in other branches
  1. 6.2 shoutbox.pages.inc \shoutbox_admin_settings()
  2. 6 shoutbox.module \shoutbox_admin_settings()
  3. 7.2 shoutbox.pages.inc \shoutbox_admin_settings()
  4. 7 shoutbox.pages.inc \shoutbox_admin_settings()

Form for admin/settings/shoutox page.

1 string reference to 'shoutbox_admin_settings'
shoutbox_menu in ./shoutbox.module
Implementation of hook_menu().

File

./shoutbox.module, line 395
shoutbox module displays a block for users to create short messages for thw whole site. Uses AHAH to update the database and display content.

Code

function shoutbox_admin_settings() {
  $form['display_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Display Settings'),
    '#collapsible' => true,
  );
  $form['display_settings']['shoutbox_showamount'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of posts to show'),
    '#default_value' => variable_get('shoutbox_showamount', 20),
    '#size' => 4,
    '#maxlength' => 4,
    '#description' => t("Set the number of shoutbox posts to show."),
  );
  $form['display_settings']['shoutbox_ascending'] = array(
    '#type' => 'checkbox',
    '#title' => t('Post newest shouts on top'),
    '#default_value' => variable_get('shoutbox_ascending', 0),
    '#description' => t('When checked, new shouts will appear on the top instead of the bottom.'),
  );
  $form['display_settings']['shoutbox_defaultname'] = array(
    '#type' => 'checkbox',
    '#title' => t('Default the name field to the logged in user name'),
    '#default_value' => variable_get('shoutbox_defaultname', 1),
    '#description' => t('When checked, "Your name/nick" will be replaced by the logged in user name'),
  );
  $form['display_settings']['shoutbox_shownamefield'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show the name field for logged in users'),
    '#default_value' => variable_get('shoutbox_shownamefield', 1),
    '#description' => t('Uncheck to hide the name field for logged in users. Name will then be the user name, so previous option will be useless.'),
  );
  $form['display_settings']['shoutbox_showurlfield'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show the url field'),
    '#default_value' => variable_get('shoutbox_showurlfield', 1),
    '#description' => t('Check to allow users to enter an url.'),
  );
  $form['shoutbox_filter_format'] = _shoutbox_filter_form();
  $form['time_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Time Settings'),
    '#collapsible' => true,
    '#collapsed' => false,
  );
  $form['time_settings']['shoutbox_refresh'] = array(
    '#type' => 'textfield',
    '#title' => t('Auto refresh (in seconds)'),
    '#default_value' => variable_get('shoutbox_refresh', 0),
    '#size' => 4,
    '#maxlength' => 4,
    '#description' => t("Shoutbox can be set to automatically refresh every x number of seconds.  Set to 0 to turn off the auto refresh (default)."),
  );
  $form['time_settings']['shoutbox_anonymous_timeout'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of minutes for which anonymous users may edit or delete their own posts'),
    '#default_value' => variable_get('shoutbox_anonymous_timeout', 20),
    '#size' => 4,
    '#maxlength' => 4,
    '#description' => t("Anonymous users can edit or delete their post within this amount of time from it being posted, as long as they have the same IP address as when they posted it.  If you don't want shout editing and/or deleting, remove these permissions from Drupal's anonymous users role."),
  );
  $form['time_settings']['shoutbox_registered_timeout'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of minutes for which registered users may edit or delete their own posts'),
    '#default_value' => variable_get('shoutbox_registered_timeout', 1440),
    '#size' => 4,
    '#maxlength' => 4,
    '#description' => t("Registered users can edit or delete their post within this amount of time from it being posted.  If you don't want editing and/or deleting, remove these permissions from Drupal's registered users role."),
  );
  $form['time_settings']['shoutbox_expire'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of days after which shouts will be purged from the database'),
    '#default_value' => variable_get('shoutbox_expire', 0),
    '#size' => 4,
    '#maxlength' => 4,
    '#description' => t("Shouts will be permanently deleted after the number of days specified.  Shouts will never expire when this is set to zero."),
  );
  return system_settings_form($form);
}