setWidth(40); $oTFAltText =& new WYTextField("ALT_TEXT"); $oTFAltText->setWidth(40); $oElement =& new WYImageElement($oEditor->sFieldName, $oEditor->bGlobal, "", "", "", (int)$oHFImageWidth->sValue(), (int)$oHFImageHeight->sValue(), ((int)$oHFIsThumb->sValue()) == 1 ? true:false, (int)$oHFThumbWidth->sValue(), (int)$oHFThumbHeight->sValue()); $oFP = od_nil; $sMaxUpload = $goApp->sFormattedByteSizeString($goApp->iMaxUploadBytes()); if ((int)$oHFDelete->sValue() == 1) { $oElement->deleteThumbnail(); $oElement->deleteImage(); // implicit save $sResponse = WYTS("ImageDeleted"); $bOK = true; } else if ($oEditor->bSave) { if ($oFU->bFileUploaded()) { if ($oFU->bUploadOK()) { $oFP =& $oFU->oFilePath(); $oOFP =& $oFU->oOriginalFilename(); if ($oOFP->bCheck(WYPATH_CHECK_JUSTIMAGE|WYPATH_CHECK_NOPATH)) { if ($oElement->bUseUploadedImageFile($oFP, $oOFP)) { $oElement->setLinkURL($oTFURL->sValue()); $oElement->setAltText($oTFAltText->sValue()); $oElement->save(); $sResponse = WYTS("ImageSaved"); $bOK = true; } else { $sResponse = WYTS("ImageStoreFailed"); $bOK = false; } } else { $goApp->log("Illegal file/type on image upload: " . $oOFP->sPath); $sResponse = WYTS("FileUploadErrorUnknown"); } $oFU->deleteTmpFile(); } else $sResponse = $oFU->sErrorMessage(); } else { // maybe only URL changed $oElement->setLinkURL($oTFURL->sValue()); $oElement->setAltText($oTFAltText->sValue()); $oElement->save(); $sResponse = WYTS("ImageSaved"); $bOK = true; } } else { $oTFURL->setValue($oElement->sLinkURL()); $oTFAltText->setValue($oElement->sAltText()); } $goApp->outputWarningPanels(); // give App a chance to say something ?>
|
||
sHelpLink($sHelpFile); ?>
";
echo " $sResponse ";
if ($bOK) echo WYEditor::sPostSaveScript();
else echo "" . webyep_sBackLink() . " "; echo ""; }?> |