Browse Source

Added functions to select form names based on wether they are ingest or edit forms.

pull/105/head
Nigel Banks 14 years ago
parent
commit
0ca2c50681
  1. 36
      ContentModel.inc

36
ContentModel.inc

@ -2047,6 +2047,42 @@ class ContentModel extends XMLDatastream {
return $names;
}
/**
*
* @return array
* An array of form names that exist in this content model.
*/
public function getIngestFormNames() {
if (!$this->validate()) {
return FALSE;
}
$result = $this->xpath->query('//cm:forms/cm:form[@ingest_class and @ingest_file and @ingest_module]/@name'); // Select the name attribute of all forms.
for($i = 0; $i < $result->length; $i++) {
$attribute = $result->item($i);
$name = $attribute->value;
$names[$name] = $name;
}
return $names;
}
/**
*
* @return array
* An array of form names that exist in this content model.
*/
public function getEditFormNames() {
if (!$this->validate()) {
return FALSE;
}
$result = $this->xpath->query('//cm:forms/cm:form[@edit_class and @edit_file and @edit_module]/@name'); // Select the name attribute of all forms.
for($i = 0; $i < $result->length; $i++) {
$attribute = $result->item($i);
$name = $attribute->value;
$names[$name] = $name;
}
return $names;
}
/**
* Removes the named form.
*

Loading…
Cancel
Save