Description

This project is aimed to provide integration for developers of jQuery Image Picker as a form element.

Example

/**
 * Page callback: delete photos
 */
function photos_delete_form() {
  global $user;

  $form['photos'] = array(
    '#type' => 'imagepicker',
    '#multiple' => TRUE,
  );
  $results = db_select('photos', 'p')
               ->fields('p')
             ->orderBy('timestamp', 'DESC')
             ->execute()
             ->fetchAllAssoc('id');
  foreach ($results as $photo) {
    $form['photos']['#options'][$photo->id] = array(
      '#value' => $photo->id,
      '#data-img-src' => _photos_build_photo_url($photo)
    );
  }

  return confirm_form($form, NULL, 'photos', NULL, t('Delete'));
}

function photos_delete_form_submit($form, $form_state) {
  if ($form_state['values']['photos']) {
    entity_delete_multiple('photo', $form_state['values']['photos']);
    drupal_set_message(t('Successfully deleted @count photos', array(
      '@count' => count($form_state['values']['photos']),
    )));
  }
}

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • caution No further development
    No longer developed by its maintainers.
  • chart icon2 sites report using this module
  • Created by SebCorbin on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    There are currently no supported stable releases.

Releases