Пример #1
0
 public static function from_xml($alias, $itnum, $xmlbuffer)
 {
     $xml = new SimpleXMLElement($xmlbuffer);
     $doc = ItemFactory::node($xml, '//xml');
     $compound_object = new CompoundObject($alias, $itnum);
     $compound_object->title = (string) $doc->title;
     $compound_object->file = (string) $doc->find;
     dmGetCompoundObjectInfo($alias, $itnum, $compound_xml_buffer);
     $compound_xml = new SimpleXMLElement($compound_xml_buffer);
     $type = $compound_xml->xpath('//cpd/type');
     if ((string) $type[0] == 'Monograph') {
         $pages = $compound_xml->xpath('//cpd/node/page');
     } else {
         $pages = $compound_xml->xpath('//cpd/page');
     }
     $num = 1;
     foreach ($pages as $page) {
         $subitnum = (string) $page->pageptr;
         $item = ItemFactory::create($alias, $subitnum, NULL);
         $compound_object->add_item($item, $num++);
     }
     return $compound_object;
 }
        $s = $monolvl[0] . "." . $monolvl[1] . "." . $monolvl[2];
    } elseif ($monolvl[4] == 0) {
        $s = $monolvl[0] . "." . $monolvl[1] . "." . $monolvl[2] . "." . $monolvl[3];
    } elseif ($monolvl[5] == 0) {
        $s = $monolvl[0] . "." . $monolvl[1] . "." . $monolvl[2] . "." . $monolvl[3] . "." . $monolvl[4];
    } elseif ($monolvl[6] == 0) {
        $s = $monolvl[0] . "." . $monolvl[1] . "." . $monolvl[2] . "." . $monolvl[3] . "." . $monolvl[4] . "." . $monolvl[5];
    } elseif ($monolvl[7] == 0) {
        $s = $monolvl[0] . "." . $monolvl[1] . "." . $monolvl[2] . "." . $monolvl[3] . "." . $monolvl[4] . "." . $monolvl[5] . "." . $monolvl[6];
    } else {
        $s = $monolvl[0] . "." . $monolvl[1] . "." . $monolvl[2] . "." . $monolvl[3] . "." . $monolvl[4] . "." . $monolvl[5] . "." . $monolvl[6] . "." . $monolvl[7];
    }
    return $s;
}
$conf =& dmGetCollectionFieldInfo($alias);
$rc = dmGetCompoundObjectInfo($alias, $parent_itnum, $data);
if ($rc == -1) {
    print "No permission to access this item<br>\n";
    exit;
}
$compound_items = parseCPD($alias, $parent_itnum, $data, $type);
$current_item_index_num = 0;
$current_item_num = 0;
if (isset($_GET["CISOSHOW"])) {
    for ($n = 0; $n < count($compound_items); $n++) {
        if ($_GET["CISOSHOW"] == $compound_items[$n]["ptr"]) {
            $current_item_index_num = $compound_items[$n]["index"];
            $current_item_num = $n;
            break;
        }
    }