| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
switch ($op) {
|
| 5 |
case 'form':
|
| 6 |
$edit = (object)$metadata;
|
| 7 |
|
| 8 |
// textual information information
|
| 9 |
$form['info'] = array(
|
| 10 |
'#type' => 'fieldset',
|
| 11 |
'#title' => t('Textual Information'),
|
| 12 |
'#collapsible' => true,
|
| 13 |
'#collapsed' => false
|
| 14 |
);
|
| 15 |
|
| 16 |
$form['info']['summary'] = array(
|
| 17 |
'#type' => 'textarea',
|
| 18 |
'#title' => t('Summary'),
|
| 19 |
'#default_value' => $edit->summary,
|
| 20 |
'#maxlength' => 255,
|
| 21 |
'#rows' => 2
|
| 22 |
);
|
| 23 |
|
| 24 |
if (variable_get('mmedia_metadata_description', false)) {
|
| 25 |
$form['info']['description'] = array(
|
| 26 |
'#type' => 'textarea',
|
| 27 |
'#title' => t('Description'),
|
| 28 |
'#default_value' => $edit->description,
|
| 29 |
);
|
| 30 |
}
|
| 31 |
|
| 32 |
// licensing information, or source relative material
|
| 33 |
$form['refinfo'] = array(
|
| 34 |
'#type' => 'fieldset',
|
| 35 |
'#title' => t('Reference Information'),
|
| 36 |
'#collapsible' => true,
|
| 37 |
'#collapsed' => false
|
| 38 |
);
|
| 39 |
|
| 40 |
$form['refinfo']['source'] = array(
|
| 41 |
'#type' => 'textfield',
|
| 42 |
'#title' => t('Source'),
|
| 43 |
'#default_value' => $edit->source,
|
| 44 |
'#maxlength' => 255
|
| 45 |
);
|
| 46 |
|
| 47 |
$form['refinfo']['reference'] = array(
|
| 48 |
'#type' => 'textfield',
|
| 49 |
'#title' => t('Reference'),
|
| 50 |
'#default_value' => $edit->reference,
|
| 51 |
'#maxlength' => 255
|
| 52 |
);
|
| 53 |
|
| 54 |
if (variable_get('mmedia_metadata_license', false)) {
|
| 55 |
$form['refinfo']['licence'] = array(
|
| 56 |
'#type' => 'textarea',
|
| 57 |
'#title' => t('Licensing'),
|
| 58 |
'#default_value' => $edit->licence,
|
| 59 |
);
|
| 60 |
}
|
| 61 |
|
| 62 |
// date related information
|
| 63 |
if (variable_get('mmedia_metadata_changed', false) && module_exists('date')) {
|
| 64 |
$form['dateinfo']['changed'] = array(
|
| 65 |
'#type' => 'date',
|
| 66 |
'#title' => t('Changed'),
|
| 67 |
'#default_value' => $edit->changed
|
| 68 |
);
|
| 69 |
}
|
| 70 |
|
| 71 |
if (variable_get('mmedia_metadata_expire', false) && module_exists('date')) {
|
| 72 |
$form['dateinfo']['expire'] = array(
|
| 73 |
'#type' => 'date',
|
| 74 |
'#title' => t('Expires'),
|
| 75 |
'#default_value' => $edit->expire,
|
| 76 |
'#description' => t('If expires is before or equal to changed, then it does not expire.')
|
| 77 |
);
|
| 78 |
}
|
| 79 |
|
| 80 |
if (isset($form['dateinfo'])) {
|
| 81 |
$form['dateinfo'] = array_merge($form['dateinfo'], array(
|
| 82 |
'#type' => 'fieldset',
|
| 83 |
'#title' => t('Date Information'),
|
| 84 |
'#collapsible' => true,
|
| 85 |
'#collapsed' => false
|
| 86 |
));
|
| 87 |
}
|
| 88 |
break;
|
| 89 |
}
|