| 1 |
<?php |
<?php |
| 2 |
// $Id: transcription.module,v 1.4 2008/10/28 14:50:12 aaron Exp $ |
// $Id: transcription.module,v 1.5 2008/10/28 14:53:29 aaron Exp $ |
| 3 |
|
|
| 4 |
// Initial code by Jonathan DeLaigle (grndlvl). |
// Initial code by Jonathan DeLaigle (grndlvl). |
| 5 |
// Modified by Aaron Winborn for the Media Transcriptions module. |
// Modified by Aaron Winborn for the Media Transcriptions module. |
| 192 |
$form[$field['field_name']][$delta]['transcription'] = array( |
$form[$field['field_name']][$delta]['transcription'] = array( |
| 193 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 194 |
'#title' => t('Transcription'), |
'#title' => t('Transcription'), |
| 195 |
'#description' => (isset($field['transcription_description'])) ? t($field['transcription_description']) : '', |
'#description' => (isset($field['transcription_description'])) ? check_plain($field['transcription_description']) : '', |
| 196 |
'#maxlength' => $field['max_length'] ? $field['max_length'] : NULL, |
'#maxlength' => $field['max_length'] ? $field['max_length'] : NULL, |
| 197 |
'#weight' => -10, |
'#weight' => -10, |
| 198 |
'#required' => ($delta == 0) ? $field['required'] : FALSE, |
'#required' => ($delta == 0) ? $field['required'] : FALSE, |
| 204 |
$form[$field['field_name']][$delta]['timemarker'] = array( |
$form[$field['field_name']][$delta]['timemarker'] = array( |
| 205 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 206 |
'#title' => t('Transcription time marker'), |
'#title' => t('Transcription time marker'), |
| 207 |
'#description' => (isset($field['transcription_timemarker_description'])) ? t($field['transcription_timemarker_description']) : '', |
'#description' => (isset($field['transcription_timemarker_description'])) ? check_plain($field['transcription_timemarker_description']) : '', |
| 208 |
'#required' => ($delta == 0) ? $field['required'] : FALSE, |
'#required' => ($delta == 0) ? $field['required'] : FALSE, |
| 209 |
'#size' => 8, |
'#size' => 8, |
| 210 |
'#maxlength' => 8, |
'#maxlength' => 8, |
| 218 |
$form[$field['field_name']][$delta] = array( |
$form[$field['field_name']][$delta] = array( |
| 219 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 220 |
'#title' => t('Media Transcription') .' '. ($delta+1), |
'#title' => t('Media Transcription') .' '. ($delta+1), |
| 221 |
'#description' => t('In order to add additional fields you must click <strong>Submit</strong> or <strong>Preview</strong>.'), |
'#description' => t('In order to add additional fields you must click %submit or %preview.', array('%submit' => t('Submit'), '%preview' => t('Preview'))), |
| 222 |
'#collapsible' => true, |
'#collapsible' => true, |
| 223 |
'#collapsed' => false, |
'#collapsed' => false, |
| 224 |
); |
); |
| 228 |
'#maxlength' => $field['max_length'] ? $field['max_length'] : NULL, |
'#maxlength' => $field['max_length'] ? $field['max_length'] : NULL, |
| 229 |
'#weight' => -10, |
'#weight' => -10, |
| 230 |
'#required' => ($delta == 0) ? $field['required'] : FALSE, |
'#required' => ($delta == 0) ? $field['required'] : FALSE, |
| 231 |
'#description' => (isset($field['transcription_description'])) ? t($field['transcription_description']) : '', |
'#description' => (isset($field['transcription_description'])) ? check_plain($field['transcription_description']) : '', |
| 232 |
); |
); |
| 233 |
if ($field['text_processing']) { |
if ($field['text_processing']) { |
| 234 |
$form[$field['field_name']][$delta]['format'] = filter_form($items[$delta]['format'], $form[$field['field_name']][$delta]['transcription']['#weight'] + 1, array($field['field_name'], $delta, 'format')); |
$form[$field['field_name']][$delta]['format'] = filter_form($items[$delta]['format'], $form[$field['field_name']][$delta]['transcription']['#weight'] + 1, array($field['field_name'], $delta, 'format')); |
| 239 |
'#title' => t('Transcription time marker'), |
'#title' => t('Transcription time marker'), |
| 240 |
'#size' => 8, |
'#size' => 8, |
| 241 |
'#maxlength' => 8, |
'#maxlength' => 8, |
| 242 |
'#description' => (isset($field['transcription_timemarker_description'])) ? t($field['transcription_timemarker_description']) : '', |
'#description' => (isset($field['transcription_timemarker_description'])) ? check_plain($field['transcription_timemarker_description']) : '', |
| 243 |
); |
); |
| 244 |
} |
} |
| 245 |
} |
} |
| 247 |
$form[$field['field_name']][0]['transcription'] = array( |
$form[$field['field_name']][0]['transcription'] = array( |
| 248 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 249 |
'#title' => t('Transcription'), |
'#title' => t('Transcription'), |
| 250 |
'#description' => (isset($field['transcription_description'])) ? t($field['transcription_description']) : '', |
'#description' => (isset($field['transcription_description'])) ? check_plain($field['transcription_description']) : '', |
| 251 |
'#maxlength' => $field['max_length'] ? $field['max_length'] : NULL, |
'#maxlength' => $field['max_length'] ? $field['max_length'] : NULL, |
| 252 |
'#weight' => -10, |
'#weight' => -10, |
| 253 |
'#default_value' => isset($items[0]['transcription']) ? $items[0]['transcription'] : '', |
'#default_value' => isset($items[0]['transcription']) ? $items[0]['transcription'] : '', |
| 260 |
'#title' => t('Transcription time marker'), |
'#title' => t('Transcription time marker'), |
| 261 |
'#size' => 8, |
'#size' => 8, |
| 262 |
'#maxlength' => 8, |
'#maxlength' => 8, |
| 263 |
'#description' => (isset($field['transcription_timemarker_description'])) ? t($field['transcription_timemarker_description']) : '', |
'#description' => (isset($field['transcription_timemarker_description'])) ? check_plain($field['transcription_timemarker_description']) : '', |
| 264 |
'#default_value' => isset($items[0]['timemarker']) && $items[0]['timemarker'] != 0 ? $items[0]['timemarker'] : '', |
'#default_value' => isset($items[0]['timemarker']) && $items[0]['timemarker'] != 0 ? $items[0]['timemarker'] : '', |
| 265 |
); |
); |
| 266 |
} |
} |