You are here

function theme_imagepicker_upload_form in Image Picker 7

Same name and namespace in other branches
  1. 6.2 imagepicker.module \theme_imagepicker_upload_form()

File

./imagepicker.module, line 1727
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function theme_imagepicker_upload_form($variables) {
  $form = $variables['form'];
  $output = '';
  $max_uploads = imagepicker_variable_get('imagepicker_max_uploads', 1);
  $max_filesize = ini_get('upload_max_filesize');
  $form['maxmsg']['#markup'] = '<div class="messages">' . t('Browse your computer for up to !c, Max %max Total', array(
    '!c' => format_plural($max_uploads, '1 Image', '@count Images'),
    '%max' => $max_filesize,
  )) . '</div>';
  for ($ct = 1; $ct <= $max_uploads; $ct++) {
    $form['file_upload_' . $ct]['#prefix'] = "<div id='imagepicker_upload_link_wrapper_{$ct}'>";
    $form['description_' . $ct]['#suffix'] = '</div>';
    if (isset($form['link_' . $ct])) {
      $form['link_' . $ct]['#markup'] = "<div class='imagepicker_upload_link' id='imagepicker_upload_link_{$ct}' style='display:none'>" . l(t('Upload another'), '', array(
        'attributes' => array(
          'onClick' => "Drupal.imagepicker_upload_link_click({$ct}); return false;",
        ),
      )) . '</div>';
    }
  }
  $output .= drupal_render_children($form);
  return $output;
}