Example #1
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);
             }
             return ew_TmpImage($wrkdata);
         }
     } else {
         $wrkfile = $this->Upload->DbValue;
         if (empty($wrkfile)) {
             $wrkfile = $this->CurrentValue;
         }
         if (!empty($wrkfile)) {
             if (!$this->UploadMultiple) {
                 $imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $wrkfile;
                 if ($this->ImageResize) {
                     $wrkwidth = $this->ImageWidth;
                     $wrkheight = $this->ImageHeight;
                     $wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight);
                     return ew_TmpImage($wrkdata);
                 } else {
                     return $imagefn;
                 }
             } else {
                 $tmpfiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $wrkfile);
                 $tmpimage = "";
                 foreach ($tmpfiles as $tmpfile) {
                     if ($tmpfile != "") {
                         $imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $tmpfile;
                         if ($this->ImageResize) {
                             $wrkwidth = $this->ImageWidth;
                             $wrkheight = $this->ImageHeight;
                             $wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight);
                             if ($tmpimage != "") {
                                 $tmpimage .= ",";
                             }
                             $tmpimage .= ew_TmpImage($wrkdata);
                         } else {
                             if ($tmpimage != "") {
                                 $tmpimage .= ",";
                             }
                             $tmpimage .= ew_ConvertFullUrl($this->UploadPath . $tmpfile);
                         }
                     }
                 }
                 return $tmpimage;
             }
         }
     }
 }
Example #2
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 #3
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 $imagefn;
             }
         }
     }
 }