| 1 |
<?php |
<?php |
| 2 |
// $Id: taxonomy_image.admin.inc,v 1.1.2.9 2009/02/17 02:45:04 nancyw Exp $ |
// $Id: taxonomy_image.admin.inc,v 1.1.2.10 2009/04/17 15:54:42 nancyw Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 21 |
|
|
| 22 |
function taxonomy_image_admin_form() { |
function taxonomy_image_admin_form() { |
| 23 |
$error = NULL; |
$error = NULL; |
| 24 |
if (!file_check_directory(file_create_path(variable_get('taxonomy_image_path', 'category_pictures')), FILE_CREATE_DIRECTORY)) { |
|
| 25 |
$error = theme('error', t('The picture directory does not exist, or is not writable.')); |
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) { |
| 26 |
|
$download = t('This site is using the public file download option.'); |
| 27 |
|
} |
| 28 |
|
else { |
| 29 |
|
$download = t('This site is using the private file download option.'); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
$form['download'] = array('#type' => 'markup', '#value' => "<p>$download</p>", '#weight' => -10); |
| 33 |
|
|
| 34 |
|
$ti_path = variable_get('taxonomy_image_path', 'category_pictures'); |
| 35 |
|
if (!file_check_directory(file_create_path($ti_path), FILE_CREATE_DIRECTORY)) { |
| 36 |
|
drupal_set_message(t('The picture directory (%path) does not exist, or is not writable.', array('%path' => $ti_path)), 'error'); |
| 37 |
} |
} |
| 38 |
|
|
| 39 |
drupal_add_css(drupal_get_path('module', 'taxonomy_image') .'/taxonomy_image.css'); |
drupal_add_css(drupal_get_path('module', 'taxonomy_image') .'/taxonomy_image.css'); |
| 51 |
$form['general']['taxonomy_image_path'] = array( |
$form['general']['taxonomy_image_path'] = array( |
| 52 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 53 |
'#title' => t('Picture image path'), |
'#title' => t('Picture image path'), |
| 54 |
'#default_value' => variable_get('taxonomy_image_path', 'category_pictures'), |
'#default_value' => $ti_path, |
| 55 |
'#size' => 60, |
'#size' => 60, |
| 56 |
'#maxlength' => 255, |
'#maxlength' => 255, |
| 57 |
'#field_prefix' => '<strong>'. $files_path .'</strong>', |
'#field_prefix' => '<strong>'. $files_path .'</strong>', |