49 lines
917 B
Plaintext
49 lines
917 B
Plaintext
<?php
|
|
// $Id$
|
|
|
|
/**
|
|
* @file
|
|
* Provides File module pages for testing purposes.
|
|
*/
|
|
|
|
/**
|
|
* Implement hook_menu().
|
|
*/
|
|
function file_module_test_menu() {
|
|
$items = array();
|
|
|
|
$items['file/test'] = array(
|
|
'title' => 'Managed file test',
|
|
'page callback' => 'drupal_get_form',
|
|
'page arguments' => array('file_module_test_form'),
|
|
'access arguments' => array('access content'),
|
|
);
|
|
|
|
return $items;
|
|
}
|
|
|
|
function file_module_test_form($form_state) {
|
|
$form = array(
|
|
'#tree' => TRUE,
|
|
);
|
|
|
|
$form['file'] = array(
|
|
'#type' => 'managed_file',
|
|
'#title' => t('Managed file'),
|
|
'#upload_location' => 'public://test',
|
|
'#progress_message' => t('Please wait...'),
|
|
);
|
|
|
|
$form['textfield'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Type a value and ensure it stays'),
|
|
);
|
|
|
|
$form['submit'] = array(
|
|
'#type' => 'submit',
|
|
'#value' => t('Save'),
|
|
);
|
|
|
|
return $form;
|
|
}
|