|
|
@ -1065,33 +1065,37 @@ class ContentModel extends XMLDatastream { |
|
|
|
if (strtolower($ingest_form->getAttribute('hide_file_chooser')) == 'TRUE') { |
|
|
|
if (strtolower($ingest_form->getAttribute('hide_file_chooser')) == 'TRUE') { |
|
|
|
$form['indicator']['ingest-file-location']['#type'] = 'hidden'; |
|
|
|
$form['indicator']['ingest-file-location']['#type'] = 'hidden'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$dsid = $ingest_form->getAttribute('dsid'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$method = $ingest_form->getElementsByTagName('form_builder_method')->item(0); |
|
|
|
$dsid = $ingest_form->getAttribute('dsid'); |
|
|
|
$module = $method->getAttribute('module'); |
|
|
|
|
|
|
|
$path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); |
|
|
|
$method = $ingest_form->getElementsByTagName('form_builder_method')->item(0); |
|
|
|
if (!file_exists($path)) { |
|
|
|
$module = $method->getAttribute('module'); |
|
|
|
self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.'; |
|
|
|
$path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); |
|
|
|
} |
|
|
|
if (!file_exists($path)) { |
|
|
|
else { |
|
|
|
self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.'; |
|
|
|
@require_once($path); |
|
|
|
|
|
|
|
$className = $method->getAttribute('class'); |
|
|
|
|
|
|
|
$methodName = ($method->getAttribute('method')); |
|
|
|
|
|
|
|
if (!class_exists($className)) { |
|
|
|
|
|
|
|
self::$errors[] = 'Build Ingest Form: class \'' . $className . ' does not exist.'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
$class = new $className; |
|
|
|
@require_once($path); |
|
|
|
$elements_array = $this->getIngestFormElements(); |
|
|
|
$className = $method->getAttribute('class'); |
|
|
|
if (method_exists($class, $methodName)) { |
|
|
|
$methodName = ($method->getAttribute('method')); |
|
|
|
$ret = $class->$methodName($form, $elements_array, $form_state); |
|
|
|
if (!class_exists($className)) { |
|
|
|
|
|
|
|
self::$errors[] = 'Build Ingest Form: class \'' . $className . ' does not exist.'; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
self::$errors[] = 'Build Ingest Form: method \'' . $className . '->' . $methodName . '\' does not exist.'; |
|
|
|
$class = new $className; |
|
|
|
|
|
|
|
$elements_array = $this->getIngestFormElements(); |
|
|
|
|
|
|
|
if (method_exists($class, $methodName)) { |
|
|
|
|
|
|
|
$ret = $class->$methodName($form, $elements_array, $form_state); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
self::$errors[] = 'Build Ingest Form: method \'' . $className . '->' . $methodName . '\' does not exist.'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
self::$errors[] = 'No XML form association exists.'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return $ret; |
|
|
|
return $ret; |
|
|
|
} |
|
|
|
} |
|
|
|