Browse Source

Merge pull request #63 from ajstanley/6.x

6.x
pull/64/merge
Ben Woodhead 13 years ago
parent
commit
010e97aeb0
  1. 4
      CollectionClass.inc
  2. 5
      CollectionPolicy.inc

4
CollectionClass.inc

@ -519,6 +519,7 @@ class CollectionClass {
$show_batch_tab = FALSE;
$policy = CollectionPolicy::loadFromCollection($this->pid, TRUE);
if(!empty($policy)){
$content_models = $policy->getContentModels();
}
@ -528,7 +529,7 @@ class CollectionClass {
if (!$show_ingest_tab) {
$view_selected = TRUE;
}
if(!$collection_items){
if (!$collection_items) {
$view_selected = FALSE;
$add_selected = TRUE;
}
@ -540,7 +541,6 @@ class CollectionClass {
'#title' => 'View',
'#selected' => $view_selected,
'#content' => $collection_items,
);
$tabset['add_tab'] = array(
'#type' => 'tabpage',

5
CollectionPolicy.inc

@ -360,13 +360,14 @@ class CollectionPolicy extends XMLDatastream {
* @param string $dsid
* @return string $nextPid
*/
public function getNextPid($dsid) {
public function getNextPid($dsid, $content_model = null) {
$ret = FALSE;
if (self::valid_dsid($dsid) && $this->validate()) {
$content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model');
$namespace = FALSE;
for ($i = 0; $namespace === FALSE && $i < $content_models->length; $i++) {
if (strtolower($content_models->item($i)->getAttribute('dsid')) == strtolower($dsid)) {
if (strtolower($content_models->item($i)->getAttribute('dsid')) == strtolower($dsid) && (strtolower($content_models->item($i)->getAttribute('pid') == $content_model) || $content_model == null)) {
$namespace = $content_models->item($i)->getAttribute('namespace');
}
}

Loading…
Cancel
Save