Example #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;
 }
Example #2
0
<?php

include_once '../config/symbini.php';
include_once $serverRoot . '/classes/ImageDetailManager.php';
header("Content-Type: text/html; charset=" . $charset);
$imgId = $_REQUEST["imgid"];
$action = array_key_exists("submitaction", $_REQUEST) ? $_REQUEST["submitaction"] : "";
$eMode = array_key_exists("emode", $_REQUEST) ? $_REQUEST["emode"] : 0;
$imgManager = new ImageDetailManager($imgId, $action ? 'write' : 'readonly');
$isEditor = false;
if ($isAdmin || array_key_exists("TaxonProfile", $userRights)) {
    $isEditor = true;
}
$status = "";
if ($isEditor) {
    if ($action == "Submit Image Edits") {
        $status = $imgManager->editImage($_POST);
        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');
        }
    }