function webyep_attachment($sFieldName, $bGlobal = false, $sCustomIcon = "") { global $goApp; $o = new WYAttachmentElement($sFieldName, $bGlobal, $sCustomIcon); $s = $o->sDisplay(); if ($goApp->bEditMode) { echo $o->sEditButtonHTML("edit-button-attachment.gif", "", $goApp->bIsiPhone ? $o->oIPhoneEditURL() : od_nil); if (!$s) { $s = $o->sName; } } echo $s; }
function sFieldNameForFile() { $s = parent::sFieldNameForFile(); $s = "au-" . $s; return $s; }
// (C) Objective Development Software GmbH // http://www.obdev.at $webyep_bDocumentPage = false; $webyep_sIncludePath = ".."; include_once "{$webyep_sIncludePath}/webyep.php"; include_once @webyep_sConfigValue("webyep_sIncludePath") . "/elements/WYAttachmentElement.php"; include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYFileUpload.php"; include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYHiddenField.php"; include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYTextField.php"; include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYEditor.php"; define("WY_QK_POST_MAX_CHECK", "POST_MAX_CHECK"); $sHelpFile = "attachment-element.php"; $oEditor = new WYEditor(); $oHFDelete = new WYHiddenField("DELETE_FILE"); $oFU = new WYFileUpload("ATTACHMENT_FILE"); $oElement = new WYAttachmentElement($oEditor->sFieldName, $oEditor->bGlobal); $oFP = od_nil; $sMaxUpload = $goApp->sFormattedByteSizeString($goApp->iMaxUploadBytes()); $bOK = false; $bDidSave = false; if ((int) $oHFDelete->sValue() == 1) { $oElement->deleteFile(); // implicit save $sResponse = WYTS("FileDeleted"); $bOK = true; } else { if ($oEditor->bSave) { if ($oFU->bUploadOK()) { $oFP =& $oFU->oFilePath(); $oOFP =& $oFU->oOriginalFilename(); if ($oOFP->bCheck(WYPATH_CHECK_NOSCRIPT | WYPATH_CHECK_NOPATH)) {