public function showDBValue(&$data, $keylink) { $value = ""; $this->upload_handler->tkeys = $keylink; $filesArray = $this->getFilesArray($data[$this->field]); $showThumbnails = $this->container->pSet->showThumbnail($this->field); $isExport = $this->container->pageType == PAGE_EXPORT || $this->container->forExport != ''; if ($showThumbnails) { $zoomboxRand = rand(11111, 99999); } foreach ($filesArray as $file) { $userFile = $this->upload_handler->buildUserFile($file); if (!$isExport) { $value .= $value != "" ? "</br>" : ""; if ($showThumbnails && $userFile["thumbnail_url"] != "" && CheckImageExtension($file["name"])) { $value .= "<a target=_blank href=\"" . runner_htmlspecialchars($userFile["url"]) . "\" class='zoombox zgallery" . $zoomboxRand . "'><img border='0'"; if ($this->is508) { $value .= " alt=\"" . runner_htmlspecialchars($userFile["name"]) . "\""; } $value .= " src=\"" . runner_htmlspecialchars(GetRootPathForResources($userFile["thumbnail_url"])) . "\" /></a>"; } else { if ($this->container->pSet->showIcon($this->field)) { $value .= '<a href="' . runner_htmlspecialchars($userFile["url"]) . '"><img style="vertical-align: middle;" src="' . GetRootPathForResources('images/icons/' . $this->getFileIconByType($file["name"], $file["type"])) . '" /></a>'; } } } if ($this->container->pSet->showCustomExpr($this->field)) { $value .= fileCustomExpression($file, $data, $this->field, $this->container->pageType); } else { if ($isExport) { $value .= ($value != "" ? ", " : "") . $file["usrName"]; } else { if ($showThumbnails && $userFile["thumbnail_url"] != "" && CheckImageExtension($file["name"]) && $value != "") { $value .= "<br />"; } $label = runner_htmlspecialchars($file["usrName"] != "" ? $file["usrName"] : $file["name"]); if ($this->searchHighlight) { $label = $this->highlightSearchWord($label, true, ""); } $value .= '<a dir="LTR" href="' . runner_htmlspecialchars($userFile["url"]) . '">' . $label . '</a>'; } } if ($this->container->pSet->showFileSize($this->field)) { $fileSizeAndUnit = $this->getFileSizeAndUnits($file["size"]); $value .= " " . str_format_number(round($fileSizeAndUnit["size"], 2)) . " " . $this->sizeUnits[$fileSizeAndUnit["unitIndex"]]; } } return $value; }
function prepare_upload($field, $controltype, $postfilename, $value, $table, $id, &$pageObject) { $abs = GetFieldData($table, $field, "Absolute", false); $file =& $_FILES["value_" . GoodFieldName($field) . "_" . $id]; if ($file["error"] || $value == "") { return false; } if (substr($controltype, 6, 1) == "1") { if (strlen($postfilename)) { $pageObject->filesToDelete[] = new DeleteFile($postfilename, GetUploadFolder($field, $table), $abs); if (GetCreateThumbnail($field, $table)) { $pageObject->filesToDelete[] = new DeleteFile(GetThumbnailPrefix($field, $table) . $postfilename, GetUploadFolder($field, $table), $abs); } } return ""; } if (substr($controltype, 6, 1) == "0") { return false; } if (strlen($file['tmp_name'])) { if (!ResizeOnUpload($field, $table)) { $pageObject->filesToMove[] = new MoveFile($file['tmp_name'], $value, GetUploadFolder($field, $table), $abs); } else { $contents = myfile_get_contents($file['tmp_name']); $ext = CheckImageExtension($file["name"]); $thumb = CreateThumbnail($contents, GetNewImageSize($field, $table), $ext); $pageObject->filesToSave[] = new SaveFile($thumb, $value, GetUploadFolder($field, $table), $abs); } } return $value; }
public function buildUserFile($file) { $userFile = array(); $userFile["name"] = $file["usrName"]; $userFile["size"] = $file["size"]; $userFile["type"] = $file["type"]; $userFile["isImg"] = CheckImageExtension($file["name"]) != false; if ($file["error"]) { $userFile["error"] = $file["error"]; } $hasThumbnail = $file["thumbnail"] != ""; $userFile["url"] = GetTableLink("mfhandler", "", "file=" . rawurlencode($userFile["name"]) . "&table=" . rawurlencode($this->table) . "&field=" . rawurlencode($this->field) . "&pageType=" . rawurlencode($this->pageType) . ($this->tkeys != "" ? $this->tkeys : "&fkey=" . $this->formStamp)); if ($hasThumbnail) { $userFile["thumbnail_url"] = $userFile["url"] . "&thumbnail=1"; } else { $userFile["thumbnail_url"] = ''; } return $userFile; }
public function showDBValue($value, $keyLink) { $imageValue = ""; $this->initUploadHandler(); $this->upload_handler->tkeys = $keyLink; $filesArray = my_json_decode($value); if (!is_array($filesArray) || count($filesArray) == 0) { if ($value == "") { $filesArray = array(); } else { $uploadedFile = $this->upload_handler->get_file_object($value); if (is_null($uploadedFile)) { $filesArray = array(); } else { $filesArray = array($uploadedFile); } } } foreach ($filesArray as $imageFile) { $userFile = $this->upload_handler->buildUserFile($imageFile); if ($this->pageObject->pSetEdit->getViewFormat($this->field) == FORMAT_FILE) { $imageValue .= $imageValue != "" ? "</br>" : ""; $imageValue .= '<a href="' . runner_htmlspecialchars($userFile["url"]) . '">' . runner_htmlspecialchars($imageFile["usrName"] != "" ? $imageFile["usrName"] : $imageFile["name"]) . '</a>'; } else { if (CheckImageExtension($imageFile["name"])) { $imageValue .= $imageValue != "" ? "</br>" : ""; if ($this->pageObject->pSetEdit->showThumbnail($this->field)) { $thumbname = $userFile["thumbnail_url"]; $imageValue .= "<a target=_blank"; $imageValue .= " href=\"" . runner_htmlspecialchars($userFile["url"]) . "\" class='zoombox'>"; $imageValue .= "<img"; if ($thumbname == "" || $imageFile["name"] == $imageFile["thumbnail"]) { $imgWidth = $this->pageObject->pSetEdit->getImageWidth($this->field); $imageValue .= $imgWidth ? " width=" . $imgWidth : ""; $imgHeight = $this->pageObject->pSetEdit->getImageHeight($this->field); $imageValue .= $imgHeight ? " height=" . $imgHeight : ""; } $imageValue .= " border=0"; if ($this->is508) { $imageValue .= " alt=\"" . runner_htmlspecialchars($userFile["name"]) . "\""; } $imageValue .= " src=\"" . runner_htmlspecialchars($userFile["thumbnail_url"]) . "\"></a>"; } else { $imageValue .= "<img"; $imgWidth = $this->pageObject->pSetEdit->getImageWidth($this->field); $imageValue .= $imgWidth ? " width=" . $imgWidth : ""; $imgHeight = $this->pageObject->pSetEdit->getImageHeight($this->field); $imageValue .= $imgHeight ? " height=" . $imgHeight : ""; $imageValue .= " border=0"; if ($this->is508) { $imageValue .= " alt=\"" . runner_htmlspecialchars($userFile["name"]) . "\""; } $imageValue .= " src=\"" . runner_htmlspecialchars($userFile["url"]) . "\">"; } } } } return $imageValue; }
$value.=" src=\"" . GetTableLink("imager") . "?table=" . $rpt_array['short_table_name'] . "&field=" . runner_htmlspecialchars(rawurlencode(fldname($fld))) . "" . $keylink . "\">"; } } } elseif ($fld["view_format"] == FORMAT_DATABASE_IMAGE && !is_wr_project()) { if ($render_mode != MODE_EXPORT) { if (is_wr_custom()) { $value = "LONG BINARY DATA - CANNOT BE DISPLAYED"; } else { $value = "<img"; $value.=" border=0"; $value.=" src=\"" . GetTableLink("dimager") . "?rname=" . runner_htmlspecialchars(rawurlencode(postvalue("rname"))) . "&field=" . runner_htmlspecialchars(rawurlencode(fldname($fld))) . "" . $keylink . "\">"; } } } elseif ($fld["view_format"] == FORMAT_FILE_IMAGE) { if ($render_mode != MODE_EXPORT) { if (CheckImageExtension(db_fld_value($data, fldname($fld)))) { if ($fld["show_thumbnail"]) { // show thumbnail $thumbname = $fld["thumbnail"] . db_fld_value($data, fldname($fld)); if (substr($fld["hlprefix"], 0, 7) != "http://" && !file_exists(getabspath($fld["hlprefix"] . $thumbname))) $thumbname = db_fld_value($data, fldname($fld)); $value = "<a target=_blank href=\"" . runner_htmlspecialchars(AddLinkPrefix($gSettings, fldname($fld), db_fld_value($data, fldname($fld)))) . "\">"; $value.="<img"; if ($thumbname == db_fld_value($data, fldname($fld))) { if ($fld["listformatobj_imgwidth"]) { $value.=" width=" . $fld["listformatobj_imgwidth"]; } if ($fld["listformatobj_imgheight"]) { $value.=" height=" . $fld["listformatobj_imgheight"]; } }
function readWebValue(&$avalues, &$blobfields, $strWhereClause, $oldValuesRead, &$filename_values) { $filename = ""; $this->getPostValueAndType(); if (FieldSubmitted($this->goodFieldName . "_" . $this->id)) { $fileNameForPrepareFunc = securityCheckFileName(postvalue("filename_" . $this->goodFieldName . "_" . $this->id)); if ($this->pageObject->pageType != PAGE_EDIT) { $prepearedFile = prepare_file($this->webValue, $this->field, "file2", $fileNameForPrepareFunc, $this->id); if ($prepearedFile !== false) { $this->webValue = $prepearedFile["value"]; $filename = $prepearedFile["filename"]; } else { $this->webValue = false; } } else { if (substr($this->webType, 0, 4) == "file") { $prepearedFile = prepare_file($this->webValue, $this->field, $this->webType, $fileNameForPrepareFunc, $this->id); if ($prepearedFile !== false) { $this->webValue = $prepearedFile["value"]; $filename = $prepearedFile["filename"]; } else { $this->webValue = false; } } else { if (substr($this->webType, 0, 6) == "upload") { if ($this->webType == "upload1") { // file deletion, read filename from the database if (!$oldValuesRead) { $rsold = db_query($this->pageObject->gQuery->gSQLWhere($strWhereClause), $this->conn); $dataold = db_fetch_array($rsold); $oldValuesRead = true; } $fileNameForPrepareFunc = $dataold[$this->field]; } $this->webValue = prepare_upload($this->field, $this->webType, $fileNameForPrepareFunc, $this->webValue, "", $this->id, $this->pageObject); } } } } else { $this->webValue = false; } if (!($this->webValue === false)) { if ($this->webValue) { if ($this->pageObject->pSetEdit->getCreateThumbnail($this->field)) { $ext = CheckImageExtension(GetUploadedFileName("value_" . $this->goodFieldName . "_" . $this->id)); $thumb = CreateThumbnail($this->webValue, $this->pageObject->pSetEdit->getThumbnailSize($this->field), $ext); $blobfields[] = $this->pageObject->pSetEdit->getStrThumbnail($this->field); $avalues[$blobfields[count($blobfields) - 1]] = $thumb; } if ($this->pageObject->pSetEdit->getResizeOnUpload($this->field)) { $ext = CheckImageExtension(GetUploadedFileName("value_" . $this->goodFieldName . "_" . $this->id)); $this->webValue = CreateThumbnail($this->webValue, $this->pageObject->pSetEdit->getNewImageSize($this->field), $ext); } } else { if ($this->pageObject->pageType == PAGE_EDIT && $this->pageObject->pSetEdit->getCreateThumbnail($this->field)) { $blobfields[] = $this->pageObject->pSetEdit->getStrThumbnail($this->field); $avalues[$blobfields[count($blobfields) - 1]] = ""; } } $blobfields[] = $this->field; $avalues[$this->field] = $this->webValue; } if ($filename && $this->pageObject->pSetEdit->getStrFilename($this->field)) { $filename_values[$this->pageObject->pSetEdit->getStrFilename($this->field)] = $filename; } }
public function showDBValue(&$data, $keylink) { if ($data[$this->field] == '') { return ''; } $this->upload_handler->tkeys = $keylink; $resultValues = array(); $arBigThumbnails = array(); $zoomboxRand = rand(11111, 99999); $filesArray = $this->getFilesArray($data[$this->field]); foreach ($filesArray as $imageFile) { $userFile = $this->upload_handler->buildUserFile($imageFile); if ($this->container->pageType == PAGE_EXPORT || $this->container->forExport != '') { $resultValues[] = $userFile["name"]; continue; } if (!CheckImageExtension($imageFile["name"])) { $resultValues[] = '<a href="' . runner_htmlspecialchars($userFile["url"]) . '">' . $userFile["name"] . '</a>'; continue; } $userFile["url"] .= "&nodisp=1"; if ($userFile["thumbnail_url"] != "") { $userFile["thumbnail_url"] .= "&nodisp=1"; } $imageValue = ''; $divSize = ''; $divBigThumbnailsSize = ''; $hasThumbnail = false; $imagePath = $this->getImagePath($imageFile["name"]); $hasBigImage = myfile_exists($imagePath); if ($this->showThumbnails) { $thumbPath = $this->getImagePath($imageFile["thumbnail"]); $hasThumbnail = myfile_exists($thumbPath); } if ($this->showThumbnails) { if ($hasThumbnail) { $imageValue .= '<img border="0"'; if ($this->is508) { $imageValue .= ' alt="' . runner_htmlspecialchars($userFile["name"]) . '"'; } $src = $userFile["thumbnail_url"] != "" ? $userFile["thumbnail_url"] : $userFile["url"]; if ($this->thumbWidth || $this->thumbHeight) { $imageValue .= $this->getSmallThumbnailStyle(); } $imageValue .= ' src="' . runner_htmlspecialchars($src) . '" />'; } else { if ($hasBigImage) { $imageValue .= '<img ' . $this->getImageSizeStyle(true) . ' border="0"'; if ($this->is508) { $imageValue .= ' alt="' . runner_htmlspecialchars($userFile["name"]) . '"'; } $imageValue .= ' src="' . runner_htmlspecialchars($userFile["url"]) . '">'; } } if ($hasBigImage && $imageValue != '') { $href = runner_htmlspecialchars($userFile["url"]); $smallThumbnailStyle = ''; $linkClass = !$this->setOfThumbnails ? "zoombox zgallery" . $zoomboxRand : ''; if ($this->thumbWidth && $this->thumbHeight) { $thumbFileUrl = $hasThumbnail ? $userFile["thumbnail_url"] : $userFile["url"]; $smallThumbnailStyle = $this->getSmallThumbnailStyle($thumbFileUrl, $hasThumbnail); $linkClass .= " background-picture"; } if ($linkClass) { $linkClass = "class='" . $linkClass . "'"; } $imageValue = '<a target="_blank" href="' . $href . '"' . $linkClass . $smallThumbnailStyle . '>' . $imageValue . '</a>'; if ($this->setOfThumbnails) { $bigThumbnailLinkStyle = $this->getBigThumbnailSizeStyles(); $bigThumbnailLink = '<a style="display: none;" href="' . $href . '" ' . ($bigThumbnailLinkStyle ? 'class="zoombox"' : '') . '>'; $bigThumbnailLink .= '<img src="' . $href . '" border="0"'; $bigThumbnailLink .= $this->getImageSizeStyle(true); $bigThumbnailLink .= '/></a>'; if (!$divBigThumbnailsSize) { $divBigThumbnailsSize = 'style="' . $bigThumbnailLinkStyle . '"'; } $arBigThumbnails[] = $bigThumbnailLink; } } } else { if ($hasBigImage) { $imageValue .= "<img"; if ($this->imageWidth) { $divSize = "width: " . $this->imageWidth . "px;"; } if ($this->imageHeight) { $divSize .= "height: " . $this->imageHeight . "px;"; } if ($divSize != "") { $divSize = 'style="' . $divSize . '"'; } $imageValue .= " border=0"; if ($this->is508) { $imageValue .= " alt=\"" . runner_htmlspecialchars($userFile["name"]) . "\""; } $imageValue .= $this->getImageSizeStyle(true) . ' src="' . runner_htmlspecialchars($userFile["url"]) . '">'; } } if ($imageValue != '') { $resultValues[] = $imageValue; } } if (count($resultValues) > 1 || count($resultValues) == 1 && $this->setOfThumbnails) { if ($this->container->pageType == PAGE_EXPORT || $this->container->forExport != '') { return implode(', ', $resultValues); } if ($this->container->pageType == PAGE_PRINT) { return implode('<br />', $resultValues); } for ($i = 0; $i < count($resultValues); $i++) { if ($i == 0) { $resultValues[$i] = '<li>' . $resultValues[$i] . '</li>'; } else { $resultValues[$i] = '<li style="display:none;">' . $resultValues[$i] . '</li>'; } } $divBigThumbnails = ''; if (count($arBigThumbnails)) { $divBigThumbnails = '<div class="big-thumbnails" ' . $divBigThumbnailsSize . '>' . implode('', $arBigThumbnails) . '</div>'; } if (!$divSize && !$this->setOfThumbnails) { $divSize = 'style="' . $this->getBigThumbnailSizeStyles(true) . '"'; } $presudoSlider = '<div class="presudoslider" ' . $divSize . '>' . $divBigThumbnails . '<ul class="viewimage-thumblist" style="list-style: none;">' . implode("", $resultValues) . '</ul>' . $hiddenFields . '</div>'; return '<div style="position:relative;" class="viewImage">' . $presudoSlider . '</div>'; } if (count($resultValues) == 1) { return $resultValues[0]; } return '<img src="' . GetRootPathForResources("images/no_image.gif") . '" />'; }
public function showDBValue(&$data, $keylink) { if ($this->container->forExport && $this->container->forExport != "excel") { return "LONG BINARY DATA - CANNOT BE DISPLAYED"; } $value = $data[$this->field]; $result = $value; if (!CheckImageExtension($result)) { return ""; } if ($this->container->forExport == "excel") { return $result; } $uploadFolder = $this->container->pSet->getUploadFolder($this->field); $finalUploadFolder = $this->container->pSet->getFinalUploadFolder($this->field); $fileName = $value; if (!myfile_exists(getabspath($finalUploadFolder . $value))) { $value = "images/no_image.gif"; } else { $value = $uploadFolder . $value; } if ($this->container->pSet->showThumbnail($this->field)) { $thumbprefix = $this->container->pSet->getStrThumbnail($this->field); // show thumbnail $thumbname = $thumbprefix . $fileName; if (substr($uploadFolder, 0, 7) != "http://") { if (!myfile_exists($finalUploadFolder . $thumbname)) { $thumbname = $value; } else { $thumbname = $uploadFolder . $thumbname; } } $linkPrefix = ""; $result = "<a target=_blank href=\"" . htmlspecialchars($value) . "\" class='zoombox'>"; $result .= "<img"; if ($this->is508) { $result .= " alt=\"" . htmlspecialchars($data[$this->field]) . "\""; } $result .= " border=0"; $result .= " src=\"" . htmlspecialchars($thumbname) . "\"></a>"; } else { $imageSize = ""; $imgWidth = $this->container->pSet->getImageWidth($this->field); if ($imgWidth) { $imageSize .= " width=" . $imgWidth; } $imgHeight = $this->container->pSet->getImageHeight($this->field); if ($imgHeight) { $imageSize .= $imgHeight ? " height=" . $imgHeight : ""; } if ($divSize != "") { $divSize = 'style="' . $divSize . '"'; } if ($this->is508) { $result = '<img alt=\\"' . htmlspecialchars($data[$this->field]) . '\\" src="' . htmlspecialchars($value) . '" ' . $imageSize . ' border="0">'; } else { $result = '<img src="' . htmlspecialchars($value) . '" ' . $imageSize . ' border="0">'; } } return $result; }
/** * */ function readWebValue(&$avalues, &$blobfields, $legacy1, $legacy2, &$filename_values) { $this->getPostValueAndType(); if (FieldSubmitted($this->goodFieldName . "_" . $this->id)) { $fileNameForPrepareFunc = securityCheckFileName(postvalue("filename_" . $this->goodFieldName . "_" . $this->id)); if ($this->pageObject->pageType != PAGE_EDIT) { $this->webValue = prepare_upload($this->field, "upload2", $fileNameForPrepareFunc, $fileNameForPrepareFunc, "", $this->id, $this->pageObject); } else { if (substr($this->webType, 0, 4) == "file") { $prepearedFile = prepare_file($this->webValue, $this->field, $this->webType, $fileNameForPrepareFunc, $this->id); if ($prepearedFile !== false) { $this->webValue = $prepearedFile["value"]; $filename = $prepearedFile["filename"]; } else { $this->webValue = false; } } else { if (substr($this->webType, 0, 6) == "upload") { if ($fileNameForPrepareFunc) { $this->webValue = $fileNameForPrepareFunc; } if ($this->webType == "upload1") { // file deletion, read filename from the database $oldValues = $this->pageObject->getOldRecordData(); $fileNameForPrepareFunc = $oldValues[$this->field]; } $this->webValue = prepare_upload($this->field, $this->webType, $fileNameForPrepareFunc, $this->webValue, "", $this->id, $this->pageObject); } } } } else { $this->webValue = false; } if (!($this->webValue === false)) { if ($this->webValue && $this->pageObject->pSetEdit->getCreateThumbnail($this->field)) { $contents = GetUploadedFileContents("value_" . $this->goodFieldName . "_" . $this->id); $ext = CheckImageExtension(GetUploadedFileName("value_" . $this->goodFieldName . "_" . $this->id)); $thumb = CreateThumbnail($contents, $this->pageObject->pSetEdit->getThumbnailSize($this->field), $ext); $this->pageObject->filesToSave[] = new SaveFile($thumb, $this->pageObject->pSetEdit->GetStrThumbnail($this->field) . $this->webValue, $this->pageObject->pSetEdit->getUploadFolder($this->field), $this->pageObject->pSetEdit->isAbsolute($this->field)); } $avalues[$this->field] = $this->webValue; } }
function GetDataInt($value, $data, $field, $format) { global $strTableName; if ($format == FORMAT_CUSTOM && $data) { return CustomExpression($value, $data, $field, ""); } $ret = ""; // long binary data? if (IsBinaryType(GetFieldType($field))) { $ret = mlang_message("LONG_BINARY"); } else { $ret = $value; } if ($ret === false) { $ret = ""; } if ($format == FORMAT_DATE_SHORT) { $ret = format_shortdate(db2time($value)); } else { if ($format == FORMAT_DATE_LONG) { $ret = format_longdate(db2time($value)); } else { if ($format == FORMAT_DATE_TIME) { $ret = str_format_datetime(db2time($value)); } else { if ($format == FORMAT_TIME) { if (IsDateFieldType(GetFieldType($field))) { $ret = str_format_time(db2time($value)); } else { $numbers = parsenumbers($value); if (!count($numbers)) { return ""; } while (count($numbers) < 3) { $numbers[] = 0; } $ret = str_format_time(array(0, 0, 0, $numbers[0], $numbers[1], $numbers[2])); } } else { if ($format == FORMAT_NUMBER) { $ret = str_format_number($value, GetFieldData($strTableName, $field, "DecimalDigits", false)); } else { if ($format == FORMAT_CURRENCY) { $ret = str_format_currency($value); } else { if ($format == FORMAT_CHECKBOX) { $ret = "<img src=\"images/check_"; if ($value && $value != 0) { $ret .= "yes"; } else { $ret .= "no"; } $ret .= ".gif\" border=0"; if (isEnableSection508()) { $ret .= " alt=\" \""; } $ret .= ">"; } else { if ($format == FORMAT_PERCENT) { if ($value != "") { $ret = $value * 100 . "%"; } } else { if ($format == FORMAT_PHONE_NUMBER) { if (strlen($ret) == 7) { $ret = substr($ret, 0, 3) . "-" . substr($ret, 3); } else { if (strlen($ret) == 10) { $ret = "(" . substr($ret, 0, 3) . ") " . substr($ret, 3, 3) . "-" . substr($ret, 6); } } } else { if ($format == FORMAT_FILE_IMAGE) { if (!CheckImageExtension($ret)) { return ""; } $thumbnailed = false; $thumbprefix = ""; if ($thumbnailed) { // show thumbnail $thumbname = $thumbprefix . $ret; if (substr(GetLinkPrefix($field), 0, 7) != "http://" && !myfile_exists(getabspath(GetLinkPrefix($field) . $thumbname))) { $thumbname = $ret; } $ret = "<a target=_blank href=\"" . htmlspecialchars(AddLinkPrefix($field, $ret)) . "\">"; $ret .= "<img"; if (isEnableSection508()) { $ret .= " alt=\"" . htmlspecialchars($data[$field]) . "\""; } $ret .= " border=0"; $ret .= " src=\"" . htmlspecialchars(AddLinkPrefix($field, $thumbname)) . "\"></a>"; } else { if (isEnableSection508()) { $ret = '<img alt=\\"".htmlspecialchars($data[$field])."\\" src="' . AddLinkPrefix($field, $ret) . '" border=0>'; } else { $ret = '<img src="' . htmlspecialchars(AddLinkPrefix($field, $ret)) . '" border=0>'; } } } else { if ($format == FORMAT_HYPERLINK) { if ($data) { $ret = GetHyperlink($ret, $field, $data); } } else { if ($format == FORMAT_EMAILHYPERLINK) { $link = $ret; $title = $ret; if (substr($ret, 0, 7) == "mailto:") { $title = substr($ret, 8); } else { $link = "mailto:" . $link; } $ret = '<a href="' . $link . '">' . $title . '</a>'; } else { if ($format == FORMAT_FILE) { $iquery = "table=" . GetTableURL($strTableName) . "&field=" . rawurlencode($field); $arrKeys = GetTableKeys($strTableName); $keylink = ""; for ($j = 0; $j < count($arrKeys); $j++) { $keylink .= "&key" . ($j + 1) . "=" . rawurlencode($data[$arrKeys[$j]]); } $iquery .= $keylink; return '<a href="download.php?' . $iquery . '">' . htmlspecialchars($ret) . '</a>'; } else { if (GetEditFormat($field) == EDIT_FORMAT_CHECKBOX && $format == FORMAT_NONE) { if ($ret && $ret != 0) { $ret = mlang_message("YES"); } else { $ret = mlang_message("NO"); } } } } } } } } } } } } } } } return $ret; }
/** * Proccess record values * * @param array $record * @param array $data * @param string $keylink */ function proccessRecordValue(&$data, &$keylink, $listFieldInfo) { $value = ""; if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_IMAGE) { if (ShowThumbnail($listFieldInfo['fName'], $this->tName)) { $thumbPref = GetThumbnailPrefix($listFieldInfo['fName'], $this->tName); $value .= "<a"; if (IsUseiBox($listFieldInfo['fName'], $this->tName)) { $value .= " rel='ibox'"; } else { $value .= " target=_blank"; } $value .= " href='imager.php?table=" . $this->shortTableName . "&field=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>"; $value .= "<img border=0"; if ($this->is508) { $value .= " alt=\"Image from DB\""; } $value .= " src='imager.php?table=" . $this->shortTableName . "&field=" . rawurlencode($thumbPref) . "&alt=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>"; $value .= "</a>"; } else { $value = "<img"; if ($this->is508) { $value .= " alt=\"Image from DB\""; } $imgWidth = GetImageWidth($listFieldInfo['fName'], $this->tName); $value .= $imgWidth ? " width=" . $imgWidth : ""; $imgHeight = GetImageHeight($listFieldInfo['fName'], $this->tName); $value .= $imgHeight ? " height=" . $imgHeight : ""; $value .= " border=0"; $value .= " src='imager.php?table=" . $this->shortTableName . "&field=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>"; } } else { if ($listFieldInfo['viewFormat'] == FORMAT_FILE_IMAGE) { if (CheckImageExtension($data[$listFieldInfo['fName']])) { if (ShowThumbnail($listFieldInfo['fName'], $this->tName)) { // show thumbnail $thumbPref = GetThumbnailPrefix($listFieldInfo['fName'], $this->tName); $thumbname = $thumbPref . $data[$listFieldInfo['fName']]; if (substr(GetLinkPrefix($listFieldInfo['fName'], $this->tName), 0, 7) != "http://" && !myfile_exists(GetUploadFolder($listFieldInfo['fName']) . $thumbname)) { $thumbname = $data[$listFieldInfo['fName']]; } $value = "<a"; if (IsUseiBox($listFieldInfo['fName'], $this->tName)) { $value .= " rel='ibox'"; } else { $value .= " target=_blank"; } $value .= " href=\"" . htmlspecialchars(AddLinkPrefix($listFieldInfo['fName'], $data[$listFieldInfo['fName']])) . "\">"; $value .= "<img"; if ($thumbname == $data[$listFieldInfo['fName']]) { $imgWidth = GetImageWidth($listFieldInfo['fName'], $this->tName); $value .= $imgWidth ? " width=" . $imgWidth : ""; $imgHeight = GetImageHeight($listFieldInfo['fName'], $this->tName); $value .= $imgHeight ? " height=" . $imgHeight : ""; } $value .= " border=0"; if ($this->is508) { $value .= " alt=\"" . htmlspecialchars($data[$listFieldInfo['fName']]) . "\""; } $value .= " src=\"" . htmlspecialchars(AddLinkPrefix($listFieldInfo['fName'], $thumbname)) . "\"></a>"; } else { $value = "<img"; $imgWidth = GetImageWidth($listFieldInfo['fName'], $this->tName); $value .= $imgWidth ? " width=" . $imgWidth : ""; $imgHeight = GetImageHeight($listFieldInfo['fName'], $this->tName); $value .= $imgHeight ? " height=" . $imgHeight : ""; $value .= " border=0"; if ($this->is508) { $value .= " alt=\"" . htmlspecialchars($data[$listFieldInfo['fName']]) . "\""; } $value .= " src=\"" . htmlspecialchars(AddLinkPrefix($listFieldInfo['fName'], $data[$listFieldInfo['fName']])) . "\">"; } } } else { if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_FILE) { $fileNameF = GetFilenameField($listFieldInfo['fName'], $this->tName); if ($fileNameF) { $fileName = $data[$fileNameF]; if (!$fileName) { $fileName = "file.bin"; } } else { $fileName = "file.bin"; } if (strlen($data[$listFieldInfo['fName']])) { $value = "<a href='getfile.php?table=" . $this->shortTableName . "&filename=" . rawurlencode($fileName) . "&field=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>"; $value .= htmlspecialchars($fileName); $value .= "</a>"; } } else { if ($listFieldInfo['viewFormat'] == FORMAT_AUDIO) { $fileName = GetData($data, $listFieldInfo['fName'], FORMAT_NONE); $fieldIsUrl = GetFieldData($this->tName, $listFieldInfo['fName'], "fieldIsVideoUrl", false); if (strlen($fileName)) { $absFileName = ""; if (!$fieldIsUrl && GetFieldData($this->tName, $listFieldInfo['fName'], "Absolute", false)) { $absFileName = GetUploadFolder($listFieldInfo['fName']) . $fileName; } elseif (!$fieldIsUrl) { $absFileName = getabspath(GetUploadFolder($listFieldInfo['fName']) . $fileName); } // if file if ($fieldIsUrl || file_exists($absFileName)) { $titleField = GetFieldData($this->tName, $listFieldInfo['fName'], 'audioTitleField', ""); $title = ""; if ($titleField) { $title = htmlspecialchars(GetData($data, $titleField, ViewFormat($titleField, $titleField))); } if ($fieldIsUrl) { $href = $fileName; } else { $href = 'download.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink; } $value = '<a class="htrack" type="audio/mpeg" title="' . $title . '" href="' . $href . '">' . $title . '</a>'; } } } else { if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_AUDIO) { $titleField = GetFieldData($this->tName, $listFieldInfo['fName'], 'audioTitleField', ""); $title = ""; if ($titleField) { $title = htmlspecialchars(GetData($data, $titleField, ViewFormat($titleField, $titleField))); } if (@$data[$listFieldInfo['fName']] != NULL) { $value = '<a class="htrack" type="audio/mpeg" title="' . $title . '" href="getfile.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink . '">' . $title . '</a>'; } else { $value = $title; } } else { if ($listFieldInfo['viewFormat'] == FORMAT_VIDEO) { $value = ""; $fieldIsUrl = GetFieldData($this->tName, $listFieldInfo['fName'], "fieldIsVideoUrl", false); $fileName = GetData($data, $listFieldInfo['fName'], FORMAT_NONE); if (strlen($fileName)) { $absFileName = ""; if (!$fieldIsUrl && GetFieldData($this->tName, $listFieldInfo['fName'], "Absolute", false)) { $absFileName = GetUploadFolder($listFieldInfo['fName']) . $fileName; } elseif (!$fieldIsUrl) { $absFileName = getabspath(GetUploadFolder($listFieldInfo['fName']) . $fileName); } // if file if ($fieldIsUrl || file_exists($absFileName)) { $videoId = 'video_' . GoodFieldName(htmlspecialchars($listFieldInfo['fName'])) . '_' . $this->recId; if ($fieldIsUrl) { $href = $fileName; } else { $href = 'download.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink; } $value = '<a href="' . $href . '" style="display:block;width:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoWidth', "") . 'px;height:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoHeight', "") . 'px;" id="' . $videoId . '"></a>'; $this->controlsMap['video'][] = $videoId; } } } else { if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_VIDEO) { if (@$data[$listFieldInfo['fName']] != NULL) { $videoId = 'video_' . GoodFieldName(htmlspecialchars($listFieldInfo['fName'])) . '_' . $this->recId; $value = '<a href="getfile.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink . '" style="display:block;width:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoWidth', 0) . 'px;height:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoHeight', 0) . 'px;" id="' . $videoId . '"></a>'; $this->controlsMap['video'][] = $videoId; } } else { if ($listFieldInfo['viewFormat'] == FORMAT_MAP) { $value = '<div id="littleMap_' . GoodFieldName($listFieldInfo['fName']) . '_' . $this->recId . '" style="width: ' . $this->googleMapCfg['fieldsAsMap'][$listFieldInfo['fName']]['width'] . 'px; height: ' . $this->googleMapCfg['fieldsAsMap'][$listFieldInfo['fName']]['height'] . 'px;"></div>'; } else { if (($listFieldInfo['editFormat'] == EDIT_FORMAT_LOOKUP_WIZARD || $listFieldInfo['editFormat'] == EDIT_FORMAT_RADIO) && GetLookupType($listFieldInfo['fName'], $this->tName) == LT_LOOKUPTABLE && GetLWLinkField($listFieldInfo['fName'], $this->tName) != GetLWDisplayField($listFieldInfo['fName'], $this->tName)) { $value = DisplayLookupWizard($listFieldInfo['fName'], $data[$listFieldInfo['fName']], $data, $keylink, MODE_LIST); } else { if (NeedEncode($listFieldInfo['fName'], $this->tName)) { $value = ProcessLargeText(GetData($data, $listFieldInfo['fName'], $listFieldInfo['viewFormat']), "field=" . rawurlencode($listFieldInfo['fName']) . $keylink, "", MODE_LIST); } else { $value = GetData($data, $listFieldInfo['fName'], $listFieldInfo['viewFormat']); } } } } } } } } } } // create address field as center link $value = $this->addCenterLink($value, $listFieldInfo['fName']); return $value; }
function readWebValue(&$avalues, &$blobfields, $strWhereClause, $oldValuesRead, &$filename_values = null) { $this->getPostValueAndType(); if (FieldSubmitted($this->goodFieldName . "_" . $this->id)) { $fileNameForPrepareFunc = securityCheckFileName(postvalue("filename_" . $this->goodFieldName . "_" . $this->id)); if ($this->pageObject->pageType != PAGE_EDIT) { $this->webValue = prepare_upload($this->field, "upload2", $fileNameForPrepareFunc, $fileNameForPrepareFunc, "", $this->id, $this->pageObject); } else { if (substr($this->webType, 0, 4) == "file") { $prepearedFile = prepare_file($this->webValue, $this->field, $this->webType, $fileNameForPrepareFunc, $this->id); if ($prepearedFile !== false) { $this->webValue = $prepearedFile["value"]; $filename = $prepearedFile["filename"]; } else { $this->webValue = false; } } else { if (substr($this->webType, 0, 6) == "upload") { if ($fileNameForPrepareFunc) { $this->webValue = $fileNameForPrepareFunc; } if ($this->webType == "upload1") { // file deletion, read filename from the database if (!$oldValuesRead) { $rsold = db_query($this->pageObject->gQuery->gSQLWhere($strWhereClause), $this->conn); $dataold = db_fetch_array($rsold); $oldValuesRead = true; } $fileNameForPrepareFunc = $dataold[$this->field]; } $this->webValue = prepare_upload($this->field, $this->webType, $fileNameForPrepareFunc, $this->webValue, "", $this->id, $this->pageObject); } } } } else { $this->webValue = false; } if (!($this->webValue === false)) { if ($this->pageObject->pSet->getResizeOnUpload($this->field) || $this->pageObject->pSet->getCreateThumbnail($this->field)) { $contents = GetUploadedFileContents("value_" . $this->goodFieldName . "_" . $this->id); } if ($this->webValue && $this->pageObject->pSet->getCreateThumbnail($this->field)) { $ext = CheckImageExtension(GetUploadedFileName("value_" . $this->goodFieldName . "_" . $this->id)); $thumb = CreateThumbnail($contents, $this->pageObject->pSet->getThumbnailSize($this->field), $ext); $this->pageObject->filesToSave[] = new SaveFile($thumb, $this->pageObject->pSet->GetStrThumbnail($this->goodFieldName) . $this->webValue, $this->pageObject->pSet->getUploadFolder($this->field), $this->pageObject->pSet->isAbsolute($this->field)); } $avalues[$this->field] = $this->webValue; } }
public function showDBValue(&$data, $keylink) { $this->upload_handler->tkeys = $keylink; $filesArray = $this->getFilesArray($data[$this->field]); $resultValues = array(); $zoomboxRand = rand(11111, 99999); foreach ($filesArray as $imageFile) { $userFile = $this->upload_handler->buildUserFile($imageFile); if ($this->container->pageType == PAGE_EXPORT || $this->container->forExport != '') { $resultValues[] = $userFile["name"]; continue; } if (CheckImageExtension($imageFile["name"])) { $userFile["url"] .= "&nodisp=1"; if ($userFile["thumbnail_url"] != "") { $userFile["thumbnail_url"] .= "&nodisp=1"; } $imageValue = ''; $divSize = ''; if ($this->container->pSet->showThumbnail($this->field)) { $imageValue .= "<a target=_blank"; $imageValue .= " href=\"" . htmlspecialchars($userFile["url"]) . "\" class='zoombox zgallery" . $zoomboxRand . "'>"; $imageValue .= "<img"; $imageValue .= " border='0'"; if ($this->is508) { $imageValue .= " alt=\"" . htmlspecialchars($userFile["name"]) . "\""; } $imageValue .= " src=\"" . htmlspecialchars($userFile["thumbnail_url"] != "" ? $userFile["thumbnail_url"] : $userFile["url"]) . "\" /></a>"; } else { $imageValue .= "<img"; $imgWidth = $this->container->pSet->getImageWidth($this->field); if ($imgWidth) { $imageValue .= " width=" . $imgWidth; $divSize = "width: " . $imgWidth . "px;"; } $imgHeight = $this->container->pSet->getImageHeight($this->field); if ($imgHeight) { $imageValue .= $imgHeight ? " height=" . $imgHeight : ""; $divSize .= "height: " . $imgHeight . "px;"; } if ($divSize != "") { $divSize = 'style="' . $divSize . '"'; } $imageValue .= " border=0"; if ($this->is508) { $imageValue .= " alt=\"" . htmlspecialchars($userFile["name"]) . "\""; } $imageValue .= ' src="' . htmlspecialchars($userFile["url"]) . '">'; } $resultValues[] = $imageValue; } else { $resultValues[] = '<a href="' . htmlspecialchars($userFile["url"]) . '">' . $userFile["name"] . '</a>'; } } if (count($resultValues) > 1) { if ($this->container->pageType == PAGE_EXPORT || $this->container->forExport != '') { return implode(', ', $resultValues); } if ($this->container->pageType == PAGE_PRINT) { return implode('<br />', $resultValues); } for ($i = 0; $i < count($resultValues); $i++) { if ($i == 0) { $resultValues[$i] = '<li>' . $resultValues[$i] . '</li>'; } else { $resultValues[$i] = '<li style="display:none;">' . $resultValues[$i] . '</li>'; } } return '<div style="position:relative;"><div class="presudoslider" ' . $divSize . '><ul style="list-style: none;">' . implode("", $resultValues) . '</ul></div></div>'; } else { if (count($resultValues) == 1) { return $resultValues[0]; } } return ""; }
function getFormattedRow($value) { $row = array('row_data' => true); $keylink = ""; for ($i = 0; $i < count($this->tKeyFields); $i++) { $keylink .= "&key" . ($i + 1) . "=" . htmlspecialchars(rawurlencode(@$value[$this->tKeyFields[$i]])); } for ($i = 0; $i < count($this->fieldsArr); $i++) { // for change pseudo foreach with condition with PHP for // foreach Fields as @f filter @f.bReportPage && (@TABLE.bReportShowDetails || @TABLE.arrReportGroupFields[strGroupField==@f.strName && nGroupInterval==0].len) order nReportPageOrder $pass = false; for ($j = 0; $j < count($this->repGroupFields); $j++) { if (!$this->fieldsArr[$i]['repPage'] || !($this->repShowDet || $this->repGroupFields[$j]['strGroupField'] == $this->fieldsArr[$i]['name'] && $this->repGroupFields[$j]['groupInterval'] === 0)) { $pass = true; } } if ($pass) { continue; } if ($this->fieldsArr[$i]['viewFormat'] == FORMAT_DATABASE_IMAGE) { if (!$this->forExport) { if ($this->fieldsArr[$i]['showThumb']) { $val .= "<a "; if (IsUseiBox($this->fieldsArr[$i]['name'], $this->tName)) { $val .= " rel='ibox'"; } else { $val .= " target=_blank"; } $val .= " href=\"imager.php?table=" . $this->shortTName . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['name'])) . $keylink . "\">"; $val .= "<img border=0"; if (isEnableSection508()) { $val .= " alt=\"Image from DB\""; } $val .= " src=\"imager.php?table=" . $this->shortTName . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['thumbnail'])) . "&alt=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['repPage'])) . $keylink . "\">"; $val .= "</a>"; } else { $val = "<img"; if ($this->fieldsArr[$i]['imageWidth']) { $val .= " width=" . $this->fieldsArr[$i]['imageWidth']; } if ($this->fieldsArr[$i]['imageHeight']) { $val .= " height=" . $this->fieldsArr[$i]['imageHeight']; } $val .= " border=0"; if (isEnableSection508()) { $val .= " alt=\"Image from DB\""; } $val .= " src=\"imager.php?table=" . $this->shortTName . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['name'])) . $keylink . "\">"; } } else { $val = mlang_message("LONG_BINARY"); } } elseif ($this->fieldsArr[$i]['viewFormat'] == FORMAT_FILE_IMAGE) { if (!$this->forExport) { if (CheckImageExtension($value[$this->fieldsArr[$i]['name']])) { if ($this->fieldsArr[$i]['showThumb']) { // show thumbnail $thumbname = $this->fieldsArr[$i]['thumbnail'] . $value[$this->fieldsArr[$i]['name']]; if (substr($this->fieldsArr[$i]['strhlPrefix'], 0, 7) != "http://" && !myfile_exists(getabspath($this->fieldsArr[$i]['strhlPrefix'] . $thumbname))) { $thumbname = $value[$this->fieldsArr[$i]['name']]; } $val = "<a"; if (IsUseiBox($this->fieldsArr[$i]['name'], $this->tName)) { $val .= " rel='ibox'"; } else { $val .= " target=_blank"; } $val .= " href=\"" . htmlspecialchars(AddLinkPrefix($this->fieldsArr[$i]['name'], $value[$this->fieldsArr[$i]['name']])) . "\">"; $val .= "<img"; if ($thumbname == $value[$this->fieldsArr[$i]['name']]) { if ($this->fieldsArr[$i]['imageWidth']) { $val .= " width=" . $this->fieldsArr[$i]['imageWidth']; } if ($this->fieldsArr[$i]['imageHeight']) { $val .= " height=" . $this->fieldsArr[$i]['imageHeight']; } } $val .= " border=0"; if (isEnableSection508()) { $val .= " alt=\"" . htmlspecialchars($value[$this->fieldsArr[$i]['name']]) . "\""; } $val .= " src=\"" . htmlspecialchars(AddLinkPrefix($this->fieldsArr[$i]['name'], $thumbname)) . "\"></a>"; } else { $val = "<img"; if ($this->fieldsArr[$i]['imageWidth']) { $val .= " width=" . $this->fieldsArr[$i]['imageWidth']; } if ($this->fieldsArr[$i]['imageHeight']) { $val .= " height=" . $this->fieldsArr[$i]['imageHeight']; } $val .= " border=0"; if (isEnableSection508()) { $val .= " alt=\"" . htmlspecialchars($value[$this->fieldsArr[$i]['name']]) . "\""; } $val .= " src=\"" . htmlspecialchars(AddLinkPrefix($this->fieldsArr[$i]['name'], $value[$this->fieldsArr[$i]['name']])) . "\">"; } } } else { $val = mlang_message("LONG_BINARY"); } } elseif ($this->fieldsArr[$i]['viewFormat'] == FORMAT_DATABASE_FILE) { if (!$this->forExport) { if ($this->fieldsArr[$i]['fileName']) { $filename = $value[$this->fieldsArr[$i]['fileName']]; if (!$filename) { $filename = "file.bin"; } } else { $filename = "file.bin"; } if (strlen($value[$this->fieldsArr[$i]['name']])) { $val = "<a href=\"getfile.php?table=" . $this->shortTName . "&filename=" . rawurlencode($filename) . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['name'])) . $keylink . "\">"; $val .= htmlspecialchars($filename); $val .= "</a>"; } } else { $val = mlang_message("LONG_BINARY"); } } elseif (($this->fieldsArr[$i]['editFormat'] == EDIT_FORMAT_LOOKUP_WIZARD || $this->fieldsArr[$i]['editFormat'] == EDIT_FORMAT_RADIO) && GetLookupType($this->fieldsArr[$i]['name'], $this->tName) == LT_LOOKUPTABLE) { $val = DisplayLookupWizard($this->fieldsArr[$i]['name'], $value[$this->fieldsArr[$i]['name']], $value, $keylink, $this->mode); } elseif (NeedEncode($this->fieldsArr[$i]['name'], $this->tName)) { $val = ProcessLargeText(GetData($value, $this->fieldsArr[$i]['name'], $this->fieldsArr[$i]['viewFormat']), "field=" . rawurlencode($this->fieldsArr[$i]['name']) . $keylink, "", $this->mode); } else { //$val = GetData($value, $this->fieldsArr[$i]['name'], $this->fieldsArr[$i]['viewFormat']); if ($this->fieldsArr[$i]['viewFormat'] == FORMAT_CHECKBOX && $this->forExport) { $val = GetData($value, $this->fieldsArr[$i]['name'], FORMAT_NONE); } else { $val = GetData($value, $this->fieldsArr[$i]['name'], $this->fieldsArr[$i]['viewFormat']); } } $row[$this->fieldsArr[$i]['goodName'] . "_value"] = $val; } if ($this->repLayout == REPORT_BLOCK) { $row[GoodFieldName('nonewgroup')] = true; } return $row; }
/** * @intellisense */ function prepare_upload($field, $controltype, $postfilename, $value, $table, $id, &$pageObject) { $abs = $pageObject->pSet->isAbsolute($field); $file=&$_FILES["value_".GoodFieldName($field)."_".$id]; $sbstr1 = substr($controltype,6,1); if($file["error"] || $value == "") { if($file["error"] != 4 && $sbstr1 != "1") return false; } if($sbstr1 == "1") { if(strlen($postfilename)) { $pageObject->filesToDelete[]=new DeleteFile($postfilename, $pageObject->pSet->getUploadFolder($field), $abs); if($pageObject->pSet->getCreateThumbnail($field,$table)) $pageObject->filesToDelete[]=new DeleteFile($pageObject->pSet->getStrThumbnail($field).$postfilename, $pageObject->pSet->getUploadFolder($field), $abs); } return ""; } if(substr($controltype,6,1)=="0") return false; if(strlen($file['tmp_name'])) { if(!$pageObject->pSet->getResizeOnUpload($field)) { $pageObject->filesToMove[] = new MoveFile($file['tmp_name'],$value, $pageObject->pSet->getUploadFolder($field),$abs); } else { $contents = myfile_get_contents($file['tmp_name']); $ext = CheckImageExtension($file["name"]); $thumb = CreateThumbnail($contents, $pageObject->pSet->getNewImageSize($field), $ext); $pageObject->filesToSave[] = new SaveFile($thumb,$value, $pageObject->pSet->getUploadFolder($field),$abs); } } return $value; }