You are here

function flickr_sets_form_flickr_admin_settings_alter in Flickr 7

Implements hook_form_FORM_ID_alter().

File

sets/flickr_sets.admin.inc, line 10
The admin settings for the Flickr Sets module.

Code

function flickr_sets_form_flickr_admin_settings_alter(&$form, &$form_state) {
  $form['#validate'][] = 'flickr_sets_admin_settings_validate';
  $form['photoset_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Photoset options'),
    '#description' => t('Clear the cache on form submit.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => 20,
  );
  $form['photoset_settings']['flickr_sets_thumb_default_size'] = array(
    '#type' => 'select',
    '#title' => t('Size for the photo representing a set'),
    '#default_value' => variable_get('flickr_sets_thumb_default_size', 's'),
    '#options' => array(
      's' => t('s: 75 px square'),
      't' => t('t: 100 px on longest side'),
      'q' => t('q: 150 px square'),
      'm' => t('m: 240 px on longest side'),
      'n' => t('n: 320 px on longest side (!)'),
      '-' => t('-: 500 px on longest side'),
      'z' => t('z: 640 px on longest side'),
      'c' => t('c: 800 px on longest side (!)'),
      'b' => t('b: 1024 px on longest side'),
    ),
    '#description' => t("!: TAKE CARE, the 'c' size (800px) is missing on Flickr images uploaded before March 1, 2012!"),
  );
  $form['photoset_settings']['flickr_sets_per_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of photosets per page'),
    '#required' => TRUE,
    '#default_value' => variable_get('flickr_sets_per_page', 8),
    '#description' => t('How many photosets display on user profile pages at <em>flickr/%uid/sets</em>. Clear the cache on form submit.'),
    '#size' => 2,
    '#maxlength' => 2,
  );
  $form['photoset_settings']['flickr_sets_photos_per_set'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of photos per set'),
    '#required' => TRUE,
    '#default_value' => variable_get('flickr_sets_photos_per_set', 6),
    '#description' => t("How many photos display in a set on user profile pages at <em>flickr/%uid/sets/%nsid</em> or in a Flickr photo field with '<em>Item Type: Photoset</em>'. Clear the cache on form submit."),
    '#size' => 2,
    '#maxlength' => 2,
  );
}