function imagepicker_upload_form in Image Picker 5
Same name and namespace in other branches
- 5.2 imagepicker.module \imagepicker_upload_form()
- 6.2 imagepicker.upload.inc \imagepicker_upload_form()
- 7 imagepicker.upload.inc \imagepicker_upload_form()
2 string references to 'imagepicker_upload_form'
- imagepicker_upload in ./
imagepicker.module - Menu callback; presents the upload form for imagepicker
- imagepicker_user_upload in ./
imagepicker.module
File
- ./
imagepicker.module, line 147 - Enables permitted roles to upload images for insertion into configured nodes.
Code
function imagepicker_upload_form($account = FALSE) {
$form['#attributes']['enctype'] = 'multipart/form-data';
$form['file_upload'] = array(
'#type' => 'file',
'#title' => t('Image file'),
'#description' => t('Browse your computer for image file'),
'#required' => TRUE,
'#value' => 1,
);
$form['thumb'] = array(
'#type' => 'textfield',
'#title' => t('Thumbnail size'),
'#size' => 10,
'#default_value' => variable_get('imagepicker_default_thumbnail_size', 100),
'#description' => t('Size in pixels of thumbnail\'s bigger side'),
'#required' => TRUE,
);
$form['scale'] = array(
'#type' => 'textfield',
'#title' => t('Scale image'),
'#size' => 10,
'#default_value' => variable_get('imagepicker_default_scale', ''),
'#description' => t('Scale image to this size in pixels if not left empty'),
);
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#description' => t('Add title for your image'),
);
$form['description'] = array(
'#type' => 'textarea',
'#title' => t('Description'),
'#rows' => 2,
'#cols' => 80,
'#description' => t('Add description for your image'),
);
if ($account) {
$form['account'] = array(
'#type' => 'hidden',
'#value' => 1,
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Upload'),
);
return $form;
}