You are here

function imagepicker_get_link_opts in Image Picker 6.2

Same name and namespace in other branches
  1. 7 imagepicker.form-elements.inc \imagepicker_get_link_opts()
3 calls to imagepicker_get_link_opts()
imagepicker_image_form in ./imagepicker.functions.inc
Function to display the image insertion form
imagepicker_settings_form in ./imagepicker.admin.inc
Function to display the imagepicker admin settings form
imagepicker_user_config_admin_form in ./imagepicker.user.inc
Submit form

File

./imagepicker.form-elements.inc, line 238
Provides various form elements.

Code

function imagepicker_get_link_opts($default = NULL) {
  $linkoptions = array(
    'none' => t('None'),
    'file' => t('File'),
    'page' => t('Page'),
  );
  if (module_exists('lightbox2') && variable_get('imagepicker_lightbox2_enable', 0)) {
    $linkoptions['lightbox'] = t('Lightbox');
  }
  if (module_exists('thickbox') && variable_get('imagepicker_thickbox_enable', 0)) {
    $linkoptions['thickbox'] = t('Thickbox');
  }
  if (module_exists('colorbox') && variable_get('imagepicker_colorbox_enable', 0)) {
    $linkoptions['colorbox'] = t('Colorbox');
  }
  return array(
    '#type' => 'radios',
    '#title' => t('Link'),
    '#options' => $linkoptions,
    '#description' => '',
    '#default_value' => $default != NULL ? $default : variable_get('imagepicker_insert_defaults_link', 'none'),
  );
}