You are here

function imagepicker_image_form in Image Picker 5

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_image_form()
  2. 6.2 imagepicker.functions.inc \imagepicker_image_form()
  3. 7 imagepicker.functions.inc \imagepicker_image_form()
1 string reference to 'imagepicker_image_form'
imagepicker_image_select in ./imagepicker.module

File

./imagepicker.module, line 493
Enables permitted roles to upload images for insertion into configured nodes.

Code

function imagepicker_image_form() {
  $showoptions = array(
    'full' => t('Full size'),
    'thumb' => t('Thumbnail'),
    'title' => t('Title'),
  );
  $linkoptions = array(
    'none' => t('None'),
    'file' => t('File'),
    'page' => t('Page'),
  );
  if (module_exists('lightbox2') && variable_get('imagepicker_lightbox2_enable', 1)) {
    $linkoptions['lightbox'] = t('Lightbox');
  }
  if (variable_get('imagepicker_default_align_show', 1)) {
    $alignoptions = array(
      'none' => t('None'),
      'fleft' => t('Float Left'),
      'fright' => t('Float right'),
    );
    $form['align'] = array(
      '#type' => 'radios',
      '#title' => t('Align'),
      '#default_value' => variable_get('imagepicker_insert_defaults_align', 'none'),
      '#options' => $alignoptions,
      '#description' => '',
      '#prefix' => '<div class="imgp_img_options">',
      '#suffix' => '</div>',
    );
  }
  $form['show'] = array(
    '#type' => 'radios',
    '#id' => 'show',
    '#title' => t('Show'),
    '#default_value' => variable_get('imagepicker_insert_defaults_show', 'full'),
    '#options' => $showoptions,
    '#description' => '',
    '#prefix' => '<div class="imgp_img_options">',
    '#suffix' => '</div>',
  );
  $form['link'] = array(
    '#type' => 'radios',
    '#title' => t('Link'),
    '#default_value' => variable_get('imagepicker_insert_defaults_link', 'none'),
    '#options' => $linkoptions,
    '#description' => '',
    '#prefix' => '<div class="imgp_img_options">',
    '#suffix' => '</div>',
  );
  $form['insert'] = array(
    '#type' => 'button',
    '#value' => t('Insert image'),
    '#prefix' => '<div id="imgp_controls">',
    '#attributes' => array(
      'onclick' => 'imagepickerInsert(this); return FALSE;',
    ),
  );
  $form['edit'] = array(
    '#type' => 'submit',
    '#value' => t('Edit image'),
  );
  $form['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Delete image'),
    '#suffix' => '</div>',
  );
  return $form;
}