You are here

function brilliant_gallery_admin in Brilliant Gallery 7

Same name and namespace in other branches
  1. 5.4 brilliant_gallery.module \brilliant_gallery_admin()
  2. 5.3 brilliant_gallery.module \brilliant_gallery_admin()
  3. 6.4 brilliant_gallery.module \brilliant_gallery_admin()
  4. 6 brilliant_gallery.module \brilliant_gallery_admin()
  5. 6.2 brilliant_gallery.module \brilliant_gallery_admin()
  6. 6.3 brilliant_gallery.module \brilliant_gallery_admin()
  7. 7.2 OLD_brilliant_gallery.module \brilliant_gallery_admin()
  8. 7.2 brilliant_gallery_config.inc \brilliant_gallery_admin()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'brilliant_gallery_admin'
brilliant_gallery_menu in ./brilliant_gallery_menu.inc
@todo Please document this function.

File

./brilliant_gallery.module, line 238

Code

function brilliant_gallery_admin($form, &$form_state) {
  $form['brilliant_gallery_folder'] = array(
    '#type' => 'textfield',
    '#title' => t('Main gallery folder used for local galleries (not for Picasa)'),
    '#default_value' => variable_get('brilliant_gallery_folder', ''),
    '#size' => 77,
    '#maxlength' => 333,
    '#description' => t("Enter the name of the main folder in which you plan to store all your future gallery folders.\n        This base folder must be located under your default file system folder (see your file system path in /admin/settings/file-system/settings).\n        If this main folder does not exist under the file system folder, create it first. Do not use trailing slashes.\n        Enter, for example, <i>albums</i> or <i>myimages/albums</i>. If you leave this field empty your gallery will show only images that reside\n        directly in the root of your file system folder."),
  );
  $form['brilliant_gallery_pcache'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom path for a cache folder'),
    '#default_value' => variable_get('brilliant_gallery_pcache', BRILLIANT_GALLERY_DEFAULT_CACHE_DIR),
    '#size' => 77,
    '#maxlength' => 333,
    '#description' => t("Temporary storage (cache) for resized local images and for images fetched from Picasa.\n        <br />It is OK to leave this field empty. If such case, a directory called 'brilliant_gallery_temp' will automatically be created in your /files directory.\n        (FYI: your /files directory is defined at /admin/settings/file-system)\n        <br />Otherwise, you can set here a custom path to a caching directory within your /files directory. Exclude trailing slashes. Example: <i>my_brilliant_gallery_temp</i>.\n        If this directory does not exist, the module will attempt to create it automatically. Note that only single directories (e.g. <i>my_brilliant_gallery_temp</i>)\n        can be created automatically. Paths such as e.g. <i>allmycaches/my_brilliant_gallery_temp</i> are valid as well but you have to create them manually."),
  );
  $form['brilliant_gallery_cache_duration'] = array(
    // Cache expiration - both DB cache and the Picasa file cache.
    '#type' => 'textfield',
    '#title' => t('Expiration time of the gallery cache (in days)'),
    '#default_value' => variable_get('brilliant_gallery_cache_duration', '90'),
    '#size' => 5,
    '#maxlength' => 5,
    '#description' => t("Images and other gallery structures are cached to improve speed of serving. Here you can set how long time they should be cached."),
  );
  $form['brilliant_gallery_maxcol'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum number of table columns'),
    '#default_value' => variable_get('brilliant_gallery_maxcol', 5),
    '#size' => 2,
    '#maxlength' => 2,
    '#description' => t("The maximum number of columns displayed in the table. If this is zero, the images will fill the row and continue on a next one."),
  );
  $form['brilliant_gallery_maximagewidth'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum width of table images'),
    '#default_value' => variable_get('brilliant_gallery_maximagewidth', 150),
    '#size' => 3,
    '#maxlength' => 4,
    '#description' => t("The maximum width of thumbnails in the table (height calculated automatically)."),
  );
  $form['brilliant_gallery_crop'] = array(
    '#type' => 'select',
    '#title' => t('Crop thumbnails to square shape'),
    '#required' => FALSE,
    '#options' => array(
      'yes' => t('yes'),
      'no' => t('no'),
    ),
    '#default_value' => variable_get('brilliant_gallery_crop', 'no'),
    '#description' => t("If selected, all image thumbnails will have the same square shape."),
  );
  $color_field_type = (function_exists('colorpicker_2_or_later') ? 'colorpicker_' : '') . 'textfield';
  $form['brilliant_gallery_bcgcolour_textfield'] = array(
    '#type' => $color_field_type,
    '#title' => t('Background colour'),
    '#description' => t('Please enter a color value in the form #RRGGBB'),
    '#default_value' => variable_get('brilliant_gallery_bcgcolour_textfield', '#000000'),
  );
  $form['brilliant_gallery_padding'] = array(
    '#type' => 'textfield',
    '#title' => t('Table cell padding'),
    '#default_value' => variable_get('brilliant_gallery_padding', 3),
    '#size' => 3,
    '#maxlength' => 3,
    '#description' => t("Cell padding (around each image) in pixels."),
  );
  $form['brilliant_gallery_overbrowser'] = array(
    '#type' => 'select',
    '#title' => t('Overlay browser'),
    '#required' => FALSE,
    '#options' => array(
      'colorbox' => t('Colorbox'),
      'lightbox' => t('Lightbox'),
      'none' => t('None'),
    ),
    '#default_value' => variable_get('brilliant_gallery_overbrowser', 'colorbox'),
    '#description' => t('Select the overlay image browser (the relevant module must be installed, of course).'),
  );
  $form['brilliant_gallery_maxwidth'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum width of full image'),
    '#default_value' => variable_get('brilliant_gallery_maxwidth', '1920'),
    '#size' => 5,
    '#maxlength' => 5,
    '#description' => t("Very large images will be scaled down to this width (in pixels) for display before they get displayed by the overlay browser."),
  );
  $form['brilliant_gallery_caption'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display file name as caption'),
    '#default_value' => variable_get('brilliant_gallery_caption', ''),
    #'#size' => 5,

    #'#maxlength' => 5,
    '#description' => t("Check this if you want the overlay browser to display a caption based on the image file name (dots and underscores are automatically replaced by spaces)."),
  );
  $form['brilliant_gallery_sort'] = array(
    '#type' => 'radios',
    '#title' => t('Sort or randomize image order'),
    '#default_value' => variable_get('brilliant_gallery_sort', '1'),
    '#options' => array(
      '1' => t('Sort images by their file names alphabetically.'),
      '' => t('The order of your gallery images will always be randomized (on each page load or cache refresh).'),
    ),
  );
  return system_settings_form($form);
}