| 1 |
<?php
|
| 2 |
// $Id: node_images.admin.inc,v 1.0 2008/05/01 23:59:24 stefano73 Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Admin page callback file for the node_images module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Menu callback for the node_images settings form.
|
| 11 |
*/
|
| 12 |
function node_images_admin_settings() {
|
| 13 |
_node_images_check_settings();
|
| 14 |
|
| 15 |
$form['node_images_path'] = array(
|
| 16 |
'#type' => 'textfield',
|
| 17 |
'#title' => t('Node images path'),
|
| 18 |
'#default_value' => variable_get('node_images_path', 'node_images'),
|
| 19 |
'#maxlength' => 255,
|
| 20 |
'#description' => t('Subdirectory in the directory %dir where the node images will be stored. This directory has to exist and be writable by Drupal. You can use the following variables: %uid, %username, %nid', array('%dir' => file_directory_path() .'/')),
|
| 21 |
'#after_build' => array('_node_images_check_directory'),
|
| 22 |
);
|
| 23 |
$form['node_images_large_resolution'] = array(
|
| 24 |
'#type' => 'textfield',
|
| 25 |
'#title' => t('Resolution for large images'),
|
| 26 |
'#default_value' => variable_get('node_images_large_resolution', '400x300'),
|
| 27 |
'#size' => 19,
|
| 28 |
'#maxlength' => 9,
|
| 29 |
'#description' => t('The size for large images in the node gallery, expressed as WIDTHxHEIGHT (e.g. 400x300).'),
|
| 30 |
);
|
| 31 |
$form['node_images_thumb_resolution'] = array(
|
| 32 |
'#type' => 'textfield',
|
| 33 |
'#title' => t('Resolution for thumbnails'),
|
| 34 |
'#default_value' => variable_get('node_images_thumb_resolution', '100x100'),
|
| 35 |
'#size' => 15,
|
| 36 |
'#maxlength' => 7,
|
| 37 |
'#description' => t('The thumbnail size expressed as WIDTHxHEIGHT (e.g. 100x75).'),
|
| 38 |
);
|
| 39 |
$form['node_images_uploadsize_default'] = array(
|
| 40 |
'#type' => 'textfield',
|
| 41 |
'#title' => t('Default maximum file size per upload'),
|
| 42 |
'#default_value' => variable_get('node_images_uploadsize_default', 1),
|
| 43 |
'#size' => 5,
|
| 44 |
'#maxlength' => 5,
|
| 45 |
'#description' => t('The default maximum file size a user can upload. If a maximum resolution is set, the size will be checked after the file has been resized.'),
|
| 46 |
'#field_suffix' => t('MB'),
|
| 47 |
);
|
| 48 |
$form['node_images_extensions'] = array(
|
| 49 |
'#type' => 'textfield',
|
| 50 |
'#title' => t('Default permitted image extensions'),
|
| 51 |
'#default_value' => variable_get('node_images_extensions', 'jpg jpeg gif png'),
|
| 52 |
'#maxlength' => 255,
|
| 53 |
'#description' => t('Default image extensions that users can upload. Separate extensions with a space and do not include the leading dot.'),
|
| 54 |
);
|
| 55 |
$form['node_images_max_images'] = array(
|
| 56 |
'#type' => 'textfield',
|
| 57 |
'#title' => t('Maximum number of images'),
|
| 58 |
'#default_value' => variable_get('node_images_max_images', 4),
|
| 59 |
'#size' => 6,
|
| 60 |
'#maxlength' => 2,
|
| 61 |
'#description' => t('The maximum number of images a user can upload for each node.'),
|
| 62 |
);
|
| 63 |
$form['node_images_md5name'] = array(
|
| 64 |
'#type' => 'checkbox',
|
| 65 |
'#title'=> t('MD5 filenames'),
|
| 66 |
'#description' => t('Override uploaded filenames with the MD5 hash of the file.'),
|
| 67 |
'#default_value' => variable_get('node_images_md5name', FALSE),
|
| 68 |
);
|
| 69 |
|
| 70 |
return system_settings_form($form);
|
| 71 |
}
|