Example #1
0
 function ExportValue($Export, $Original)
 {
     $ExportValue = $Original ? $this->CurrentValue : $this->ViewValue;
     if ($Export == "xml" && is_null($ExportValue)) {
         $ExportValue = "<Null>";
     }
     if ($Export == "pdf") {
         if ($this->FldViewTag == "IMAGE") {
             if ($this->FldDataType == EW_DATATYPE_BLOB) {
                 $wrkdata = $this->Upload->DbValue;
                 if (!empty($wrkdata)) {
                     if ($this->ImageResize) {
                         $wrkwidth = $this->ImageWidth;
                         $wrkheight = $this->ImageHeight;
                         ew_ResizeBinary($wrkdata, $wrkwidth, $wrkheight, $this->ResizeQuality);
                     }
                     $imagefn = ew_TmpImage($wrkdata);
                     if ($imagefn != "") {
                         $ExportValue = "<img src=\"" . $imagefn . "\">";
                     }
                 }
             } else {
                 $wrkfile = $this->Upload->DbValue;
                 if (empty($wrkfile)) {
                     $wrkfile = $this->CurrentValue;
                 }
                 if (!empty($wrkfile)) {
                     $imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $wrkfile;
                     if ($this->ImageResize) {
                         $wrkwidth = $this->ImageWidth;
                         $wrkheight = $this->ImageHeight;
                         $wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight, $this->ResizeQuality);
                         $imagefn = ew_TmpImage($wrkdata);
                     } else {
                         $imagefn = ew_TmpFile($imagefn);
                     }
                     if ($imagefn != "") {
                         $ExportValue = "<img src=\"" . $imagefn . "\">";
                     }
                 }
             }
         } else {
             $ExportValue = str_replace("<br>", "\r\n", $ExportValue);
             $ExportValue = strip_tags($ExportValue);
             $ExportValue = str_replace("\r\n", "<br>", $ExportValue);
         }
     }
     return $ExportValue;
 }
Example #2
0
 function GetTempImage()
 {
     if ($this->FldDataType == EW_DATATYPE_BLOB) {
         $wrkdata = $this->Upload->DbValue;
         if (!empty($wrkdata)) {
             if ($this->ImageResize) {
                 $wrkwidth = $this->ImageWidth;
                 $wrkheight = $this->ImageHeight;
                 ew_ResizeBinary($wrkdata, $wrkwidth, $wrkheight, $this->ResizeQuality);
             }
             return ew_TmpImage($wrkdata);
         }
     } else {
         $wrkfile = $this->Upload->DbValue;
         if (empty($wrkfile)) {
             $wrkfile = $this->CurrentValue;
         }
         if (!empty($wrkfile)) {
             $imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $wrkfile;
             if ($this->ImageResize) {
                 $wrkwidth = $this->ImageWidth;
                 $wrkheight = $this->ImageHeight;
                 $wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight, $this->ResizeQuality);
                 return ew_TmpImage($wrkdata);
             } else {
                 return ew_TmpFile($imagefn);
             }
         }
     }
 }