@ -69,9 +69,9 @@ class ModsFormBuilder extends FormBuilder {
);
$includeEl = true;
$name = explode('][', $element['name']);
$el name = explode('][', $element['name']);
$elLocation = &$form['indicator2'];
while (isset($elLocation[$name[0]]) & & ($partial = array_shift($name)) != NULL) {
while (isset($elLocation[$name[0]]) & & ($partial = array_shift($el name)) != NULL) {
$elLocation = &$elLocation[$partial];
}
@ -214,7 +214,7 @@ class ModsFormBuilder extends FormBuilder {
}
if ($includeEl) {
$elLocation[join('][', $name)] = $el;
$elLocation[join('][', $el name)] = $el;
}
}
@ -661,7 +661,7 @@ class ModsFormBuilder extends FormBuilder {
if (isset($form_values['mods_people']) & & isset($form_values['mods_people']['people']) & & is_array($form_values['mods_people']['people']) ) {
foreach ($form_values['mods_people']['people'] as $key => $val) {
$name = $dom->createElement('mods:name');
$appendName=FALSE;
if (isset($val['role'])) {
$role = $dom->createElement('mods:role');
$roleTerm = $dom->createElement('mods:roleTerm', htmlspecialchars(trim($val['role'])));
@ -676,6 +676,7 @@ class ModsFormBuilder extends FormBuilder {
if (trim($val['organization']) != '') {
$namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['organization'])));
$name->appendChild($namePart);
$appendName=TRUE;
}
}
elseif (isset($val['conference'])) {
@ -683,6 +684,7 @@ class ModsFormBuilder extends FormBuilder {
if (trim($val['conference']) != '') {
$namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['conference'])));
$name->appendChild($namePart);
$appendName=TRUE;
}
}
else {
@ -690,6 +692,7 @@ class ModsFormBuilder extends FormBuilder {
if (trim($val['name']) != '') {
$namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['name'])));
$name->appendChild($namePart);
$appendName=TRUE;
}
}
@ -699,13 +702,14 @@ class ModsFormBuilder extends FormBuilder {
$name->appendChild($namePart);
}
if ($appendName) {
if (isset($val['subject'])) {
$subject->appendChild($name);
$hasSubject=TRUE;
} else
{
} else {
$mods->appendChild($name);
}
}
}
}