Esempio n. 1
0
 /** 
  * Obtain a hyperlink to the appropriate display page for the table and row referenced 
  * in this action request.
  * 
  * @return a text string containing an a with href to the display page for the row  
  *   referenced by fk with a brief text description of the row, or an empty string 
  *   if there is an error condition, including the absence of an implementation for
  *   the table in this function.
  */
 public function getLinkToRow()
 {
     $result = "";
     if ($this->tablename == "omoccurrences") {
         $occ = new OmOccurrences();
         $occ->load($this->fk);
         $result = "<a href='../collections/individual/index.php?occid={$this->fk}&clid=0'>" . $occ->getinstitutionCode() . ":" . $occ->getcollectionCode() . " " . $occ->getcatalogNumber() . "</a>";
     }
     if ($this->tablename == "images") {
         $im = new ImageDetailManager($this->fk);
         $imArr = $im->getImageMetadata();
         if (isset($imArr['sciname'])) {
             $caption .= $imArr['sciname'];
         } elseif (isset($imArr['caption'])) {
             $caption .= $imArr['caption'];
         } elseif (isset($imArr['photographer'])) {
             $caption .= $imArr['photographer'];
         } else {
             $caption = $imArr['imagetype'];
         }
         $caption .= " " . $imArr['initialtimestamp'];
         $caption = trim($caption);
         $result = "<a href='../imagelib/imgdetails.php?imgid={$this->fk}'>" . $caption . "</a>";
     }
     return $result;
 }
Esempio n. 2
0
        if (is_numeric($status)) {
            header('Location: ../taxa/admin/tpeditor.php?tid=' . $status . '&tabindex=1');
        }
    } elseif ($action == "Transfer Image") {
        $imgManager->changeTaxon($_REQUEST["targettid"], $_REQUEST["sourcetid"]);
        header('Location: ../taxa/admin/tpeditor.php?tid=' . $_REQUEST["targettid"] . '&tabindex=1');
    } elseif ($action == "Delete Image") {
        $imgDel = $_REQUEST["imgid"];
        $removeImg = array_key_exists("removeimg", $_REQUEST) ? $_REQUEST["removeimg"] : 0;
        $status = $imgManager->deleteImage($imgDel, $removeImg);
        if (is_numeric($status)) {
            header('Location: ../taxa/admin/tpeditor.php?tid=' . $status . '&tabindex=1');
        }
    }
}
$imgArr = $imgManager->getImageMetadata($imgId);
if ($imgArr) {
    $imgUrl = $imgArr["url"];
    $origUrl = $imgArr["originalurl"];
    $metaUrl = $imgArr["url"];
    if (array_key_exists("imageDomain", $GLOBALS)) {
        if (substr($imgUrl, 0, 1) == "/") {
            $imgUrl = $GLOBALS["imageDomain"] . $imgUrl;
            $metaUrl = $GLOBALS["imageDomain"] . $metaUrl;
        }
        if ($origUrl && substr($origUrl, 0, 1) == "/") {
            $origUrl = $GLOBALS["imageDomain"] . $origUrl;
        }
    }
    if (substr($metaUrl, 0, 1) == "/") {
        $metaUrl = 'http://' . $_SERVER['SERVER_NAME'] . $metaUrl;