You are here

function timeago_admin in Timeago 5

Same name and namespace in other branches
  1. 6.2 timeago.module \timeago_admin()
  2. 6 timeago.module \timeago_admin()
  3. 7.2 timeago.module \timeago_admin()
  4. 7 timeago.module \timeago_admin()

Module configuration settings

Return value

settings HTML or deny access

1 string reference to 'timeago_admin'
timeago_menu in ./timeago.module

File

./timeago.module, line 135

Code

function timeago_admin() {

  // only administrators can access this module
  if (!user_access("access administration pages")) {
    return message_access();
  }
  $form['timeago_node'] = array(
    '#type' => 'fieldset',
    '#title' => t('Time ago node settings'),
    '#description' => t('Enter date format, max time and number of parts to display for a node.'),
  );
  $form['timeago_node']["timeago_node_dateformat_title"] = array(
    '#type' => 'radios',
    '#title' => t('Date format of title'),
    '#description' => t('The date you will see when you hover over the date.'),
    '#default_value' => variable_get('timeago_node_dateformat_title', 'large'),
    '#options' => array(
      'small' => 'Small',
      'medium' => 'Medium',
      'large' => 'Large',
    ),
  );
  $form['timeago_node']["timeago_node_dateformat_view"] = array(
    '#type' => 'radios',
    '#title' => t('Date format when showing the normal date'),
    '#description' => t('This setting kicks in when the number of seconds that you set below are exceeded.'),
    '#default_value' => variable_get('timeago_node_dateformat_view', 'medium'),
    '#options' => array(
      'small' => 'Small',
      'medium' => 'Medium',
      'large' => 'Large',
    ),
  );
  $form['timeago_node']["timeago_node_maxdate"] = array(
    '#type' => 'textfield',
    '#title' => t('Number of seconds before it shows a normal date'),
    '#default_value' => variable_get('timeago_node_maxdate', '32556926'),
  );
  $form['timeago_node']["timeago_node_round"] = array(
    '#type' => 'radios',
    '#title' => t('Number of parts to show'),
    '#default_value' => variable_get('timeago_node_round', 3),
    '#options' => array(
      1 => '1',
      2 => '2',
      3 => '3',
      4 => '4',
      5 => '5',
      6 => '6',
      7 => '7',
    ),
  );
  return system_settings_form($form);
}