$oTrashImg = new WYImage($oURL); $oTrashImg->setAttribute("style", "border: 0"); foreach ($aEntries as $dEntry) { if ($iCol == 0) { echo "<tr>"; } $sFilename = $dEntry[FILENAME]; $sDisplayFilename = str_replace("rtimg-", "", $sFilename); $sDisplayFilename = preg_replace('|([-_])|', '\\1­', $sDisplayFilename); $sURL = $dEntry[URL]; $sPath = $dEntry[PATH]; $oImg = new WYImage(new WYURL($sURL)); $iWidth = $oImg->iWidth(); $iHeight = $oImg->iHeight(); if ($iWidth != 0 && $iHeight != 0) { WYImage::bLimitSize($iWidth, $iHeight, IMG_SIZE, IMG_SIZE); } else { $iWidth = $iHeight = IMG_SIZE; } $oImg->setAttribute("width", $iWidth); $oImg->setAttribute("height", $iHeight); $oImg->setAttribute("style", "border: 0"); unset($oTrashLink); unset($oTrashLinkURL); $oTrashLinkURL = od_clone(WYURL::oCurrentURL()); $oTrashLinkURL->dQuery[ACTION] = ACTION_DELETE; $oTrashLinkURL->dQuery[FILENAME] = $sFilename; $oTrashLink = new WYLink($oTrashLinkURL); $oTrashLink->setAttribute("onclick", "return confirmDelete()"); $oTrashLink->setInnerHTML($oTrashImg->sDisplay()); $oTrashLink->setToolTip(WYTS("DeleteImageButton"));
/** * Liefert das Vorschaubild zu einem gegebenen Dateinamen * * @param string der Dateiname * @return object ein WYImage-Objekt, welches das Vorschaubild kapselt */ function &_oTNImage($sFilename) { global $goApp, $webyep_sLiveDemoSlotID; $oImg = od_nil; $oURL = od_nil; $sTNName = ""; $fFactor = 0.0; $iW = $iH = 0; $oURL = od_clone($goApp->oDataURL); $sTNName = $this->_sThumbnailName($sFilename); $oURL->addComponent($sTNName); $oImg = new WYImage($oURL); if ($webyep_sLiveDemoSlotID && !$oImg->bExists()) { $oURL->removeDemoSlotID(); unset($oImg); $oImg = new WYImage($oURL); } if (isset($oImg->dAttributes["width"]) && isset($oImg->dAttributes["height"])) { WYImage::bLimitSize($oImg->dAttributes["width"], $oImg->dAttributes["height"], $this->iTNWidth, $this->iTNHeight); } else { // if size can't be determined, set at least max width $goApp->log("could not determine image size of {$sTNName}"); $oImg->dAttributes["width"] = $this->iTNWidth; unset($oImg->dAttributes["height"]); } return $oImg; }