Browse Source

Fixes for the content modeler. Lists have become sets.

pull/105/head
Nigel Banks 14 years ago
parent
commit
9635c23c70
  1. 20
      ContentModel.inc
  2. 48
      islandoracm.xsd

20
ContentModel.inc

@ -2105,8 +2105,13 @@ class ContentModel extends XMLDatastream {
} }
$result = $this->xpath->query("//cm:form[@name='$name']"); $result = $this->xpath->query("//cm:form[@name='$name']");
if($result->length == 1) { if($result->length == 1) {
$element = $this->xml->importNode($element);
$form = $result->item(0); $form = $result->item(0);
$result = $this->xpath->query("child::node()", $form);
$element = $this->xml->importNode($element);
for($i = 0; $i < $result->length; $i++) {
$child = $result->item($i);
$element->appendChild($child);
}
$form->parentNode->replaceChild($element, $form); $form->parentNode->replaceChild($element, $form);
return TRUE; return TRUE;
} }
@ -2132,8 +2137,17 @@ class ContentModel extends XMLDatastream {
*/ */
public function editFormElement($new_element, $edit_element) { public function editFormElement($new_element, $edit_element) {
$new_element = $this->xml->importNode($new_element, TRUE); $new_element = $this->xml->importNode($new_element, TRUE);
$this->insertElementInPlace($new_element, $edit_element); $name = $new_element->tagName;
$edit_element->parentNode->removeChild($edit_element); $result = $new_element->getElementsByTagName('content');
if($result->length == 1) {
$new_content = $result->item(0);
$result = $this->xpath->query("child::cm:content/child::node()", $edit_element);
for($i = 0; $i < $result->length; $i++) {
$child = $result->item($i);
$new_content->appendChild($child);
}
}
$edit_element->parentNode->replaceChild($new_element, $edit_element);
return TRUE; return TRUE;
} }

48
islandoracm.xsd

@ -193,45 +193,46 @@
<xsd:choice maxOccurs="unbounded" minOccurs="0"> <xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element maxOccurs="1" minOccurs="1" name="fieldset"> <xsd:element maxOccurs="1" minOccurs="1" name="fieldset">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element default="true" minOccurs="0" name="collapsible" <xsd:element default="true" minOccurs="0" name="collapsible"
type="xsd:boolean"/> type="xsd:boolean"/>
<xsd:element default="false" minOccurs="0" name="collapsed" <xsd:element default="false" minOccurs="0" name="collapsed"
type="xsd:boolean"/> type="xsd:boolean"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"/>
<xsd:element name="content" type="formElementType"/> <xsd:element name="content" type="formElementType"/>
</xsd:sequence> <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/>
</xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="textfield"> <xsd:element name="textfield">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="required" type="xsd:boolean"/> <xsd:element minOccurs="0" name="required" type="xsd:boolean"/>
<xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element minOccurs="1" name="textarea"> <xsd:element minOccurs="1" name="textarea">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="required" type="xsd:boolean"/> <xsd:element minOccurs="0" name="required" type="xsd:boolean"/>
<xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="select"> <xsd:element maxOccurs="1" minOccurs="1" name="select">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element name="options" type="formControlOptionsType"/> <xsd:element name="options" type="formControlOptionsType"/>
@ -239,73 +240,74 @@
<xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element minOccurs="1" name="list"> <xsd:element minOccurs="1" name="set">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="required" type="xsd:boolean"/> <xsd:element minOccurs="0" name="required" type="xsd:boolean"/>
<xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element minOccurs="1" name="filechooser"> <xsd:element minOccurs="1" name="filechooser">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="required" type="xsd:boolean"/> <xsd:element minOccurs="0" name="required" type="xsd:boolean"/>
<xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element minOccurs="1" name="datepicker"> <xsd:element minOccurs="1" name="datepicker">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="required" type="xsd:boolean"/> <xsd:element minOccurs="0" name="required" type="xsd:boolean"/>
<xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="default_value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="tabpanel"> <xsd:element maxOccurs="1" minOccurs="1" name="tabpanel">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"/>
<xsd:element name="content" type="formElementType"/> <xsd:element name="content" type="formElementType"/>
</xsd:sequence> <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/>
</xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="checkbox"> <xsd:element name="checkbox">
<xsd:complexType> <xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1"> <xsd:all maxOccurs="1" minOccurs="1">
<xsd:element name="title" type="xsd:normalizedString"/> <xsd:element name="title" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/> <xsd:element minOccurs="0" name="description" type="xsd:normalizedString"/>
<xsd:element name="return_value" type="xsd:normalizedString"/> <xsd:element name="return_value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element minOccurs="1" name="hidden"> <xsd:element minOccurs="1" name="hidden">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:all>
<xsd:element minOccurs="1" name="value" type="xsd:normalizedString"/> <xsd:element minOccurs="1" name="value" type="xsd:normalizedString"/>
<xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType" <xsd:element minOccurs="0" name="form_builder" type="formBuilderControlType"
/> />
</xsd:sequence> </xsd:all>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>

Loading…
Cancel
Save