public function basic_view($alias, $display_item, $parent_item, $image_types, $encoded_seek_search_params, $search_position, $seek_search_params, $isthisCompoundObject, $previous_item, $next_item, $current_item_num, $totalitems)
 {
     $conf =& dmGetCollectionFieldInfo($alias);
     $itnum = $display_item['ptr'];
     $rc = dmGetItemInfo($alias, $itnum, $data);
     $parser = xml_parser_create();
     xml_parse_into_struct($parser, $data, $structure, $index);
     xml_parser_free($parser);
     dmGetImageInfo($alias, $itnum, $filename, $type, $width, $height);
     $filename = substr($filename, strrpos($filename, "/") + 1);
     $file_extension = GetFileExt($filename);
     if (in_array($file_extension, $image_types)) {
         $is_image = true;
         $dimensions = Image::fit_width($width, $height, 640);
         $scaled_width = $dimensions[0];
         $scaled_height = $dimensions[1];
         $scaling_factor = $dimensions[2];
         $file_url = "http://cdm9006.cdmhost.com/cgi-bin/getimage.exe?CISOROOT=" . $alias . "&CISOPTR=" . $itnum;
         $file_url .= "&DMWIDTH=" . $scaled_width . "&DMHEIGHT=" . $scaled_height . "&DMSCALE=" . $scaling_factor;
     } else {
         $is_image = false;
         $file_url = "http://cdm9006.cdmhost.com/cgi-bin/showfile.exe?CISOROOT=" . $alias . "&CISOPTR=" . $itnum;
         $encoded_file_url = urlencode("http://cdm9006.cdmhost.com/cgi-bin/showfile.exe?CISOROOT=" . $alias . "&CISOPTR=" . $itnum);
     }
     include 'basic_view.php';
 }
    } elseif ($monolvl[3] == 0) {
        $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;
        }
Beispiel #3
0
function &dmGetFindNick($alias)
{
    $res = array();
    $n = 0;
    if ($alias == "dc") {
        $infile = FIND_DIR . "/config/finddc.txt";
        if (file_exists($infile)) {
            $fd = fopen($infile, "r");
            if ($fd) {
                while (!feof($fd)) {
                    $t = fgets($fd, 2048);
                    $s = explode(" ", $t);
                    $j = count($s);
                    if ($j > 1) {
                        $left = strtolower(trim($s[0]));
                        $right = trim($s[$j - 1]);
                        if ($left == "collection") {
                            continue;
                        }
                        if ($left == "cdmid") {
                            break;
                        }
                        $res[$n]["findnick"] = $left;
                        $res[$n]["cdmnick"] = $right;
                        if (substr($right, 0, 4) == "date") {
                            $res[$n]["date"] = 1;
                        } else {
                            $res[$n]["date"] = 0;
                        }
                        $n++;
                    }
                }
            }
        }
        fclose($fd);
    } else {
        $conf =& dmGetCollectionFieldInfo($alias);
        for ($i = 0; $i < count($conf); $i++) {
            if ($conf[$i]["search"] == 1) {
                $res[$n]["findnick"] = $conf[$i]["find"];
                $res[$n]["cdmnick"] = $conf[$i]["nick"];
                if ($conf[$i]["type"] == "DATE") {
                    $res[$n]["date"] = 1;
                } else {
                    $res[$n]["date"] = 0;
                }
                $n++;
            }
        }
    }
    return $res;
}
function isHide($c, $a)
{
    $hide = false;
    $conf =& dmGetCollectionFieldInfo($c);
    for ($i = 0; $i < count($conf); $i++) {
        if ($conf[$i]["nick"] == $a) {
            $hide = $conf[$i]["hide"] == "1" ? true : 0;
        }
    }
    return $hide;
}
Beispiel #5
0
 public function metadata()
 {
     $confs =& dmGetCollectionFieldInfo($this->alias);
     $std_fields = array();
     $parser = xml_parser_create();
     xml_parse_into_struct($parser, $this->xml(), $structure, $index);
     xml_parser_free($parser);
     foreach ($confs as $conf) {
         $tag = strtoupper($conf["nick"]);
         if ($conf["type"] != "FTS" && array_key_exists($tag, $index) && array_key_exists("value", $structure[$index[$tag][0]]) && $conf['hide'] != 1) {
             $value = '';
             if ($conf["type"] == "DATE") {
                 $value = $this->linkDate($structure[$index[$tag][0]]["value"], $this->alias, $conf["nick"]);
             } else {
                 if ($conf["search"] == "1" && $conf["vocab"] == "1") {
                     $value = $this->vocabLink($this->charReplace($structure[$index[$tag][0]]["value"]), $this->alias, $conf["nick"]);
                 } elseif ($conf["search"] == "1" && $conf["vocab"] == "0") {
                     $value = $this->makeLinks($this->isHyperlink($this->charReplace($structure[$index[$tag][0]]["value"]), $conf["type"], $conf["nick"], $this->alias));
                 } else {
                     $value = $this->makeLinks($this->charReplace($structure[$index[$tag][0]]["value"]));
                 }
             }
             $std_fields[$conf['name']] = $value;
         }
     }
     return $std_fields;
 }