Browse Source

Fixed ahah problems with embedded form.

pull/3/merge
Nigel Banks 14 years ago
parent
commit
5d9027171a
  1. 9
      formClass.inc

9
formClass.inc

@ -485,7 +485,6 @@ class formClass {
return FALSE; return FALSE;
} }
$contentModels = $cp->getContentModels(); $contentModels = $cp->getContentModels();
if (!$contentModels) { if (!$contentModels) {
@ -531,9 +530,10 @@ class formClass {
module_load_include('inc', 'fedora_repository', 'MimeClass'); // Why this include? --Zac, 2010-09-17 module_load_include('inc', 'fedora_repository', 'MimeClass'); // Why this include? --Zac, 2010-09-17
$contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']);
$contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']);
if (isset($form_state['values']['forms'])) { // XML Forms
module_load_include('inc', 'xml_form_api', 'XMLForm'); module_load_include('inc', 'xml_form_api', 'XMLForm');
$xml_form = new XMLForm($form_state); $xml_form = new XMLForm($form_state);
if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) {
if (!$xml_form->isInitialized()) { if (!$xml_form->isInitialized()) {
module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); module_load_include('inc', 'xml_form_api', 'XMLFormDefinition');
module_load_include('inc', 'xml_form_builder', 'FormBuilder'); module_load_include('inc', 'xml_form_builder', 'FormBuilder');
@ -546,6 +546,7 @@ class formClass {
} }
$form = $xml_form->toArray(); $form = $xml_form->toArray();
} }
// End XML forms
else if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { else if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) {
$form = $cm->buildIngestForm($form, $form_state); $form = $cm->buildIngestForm($form, $form_state);
if ($form === FALSE) { if ($form === FALSE) {

Loading…
Cancel
Save