function sDisplay() { global $goApp; $sHTML = ""; $sFN = $this->sDownloadFileName(); $oURL = $oLink = od_nil; if ($sFN) { $oURL = od_clone($goApp->oProgramURL); $oURL->addComponent("mp3-player.php"); $oURL->dQuery[WY_QK_AUDIO_FILENAME] = $sFN; $oURL->dQuery[WY_QK_AUDIO_ORG_FILENAME] = $this->sOriginalFilename(); $oLink = new WYPopupWindowLink($oURL, "WebYepAudioPlayer", 380, 150, WY_POPWIN_TYPE_PLAIN); $oLink->setToolTip(WYTS("AudioPlayHint")); $oDownloadURL = od_clone($goApp->oProgramURL); $oDownloadURL->addComponent("download.php"); $oDownloadURL->dQuery[WY_QK_DOWNLOAD_FILENAME] = $sFN; $oDownloadURL->dQuery[WY_QK_ORIGINAL_FILENAME] = $this->sOriginalFilename(); $oLink->setAttribute("href", $oDownloadURL->sEURL()); $sL = $this->sLinkContent; if ($sL == "") { $sL = webyep_sHTMLEntities($this->sOriginalFilename()); } $oLink->setInnerHTML($sL); $sHTML .= $oLink->sDisplay(); } return $sHTML; }
function WYPopupWindowLink($oURL, $sName, $iW, $iH, $iType) { global $goApp; $sJS = ""; parent::WYHTMLTag("a"); $this->bSingular = false; $this->dAttributes["href"] = $oURL->sEURL(); $sJS = WYPopupWindowLink::sOpenWindowCode($oURL, $sName, $iW, $iH, $iType); $sJS .= "; return false;"; $this->dAttributes["onclick"] = webyep_sHTMLEntities($sJS); }
function sNoticeWindowJS($sTitleKey, $sMsgKey, $sHelpFile = "") { $s = ""; $oURL = od_nil; if (!strstr($_SERVER['PHP_SELF'], "notice.php")) { $s .= "<script type='text/javascript'>\n"; $oURL = od_clone($this->oProgramURL); $oURL->addComponent("notice.php"); $oURL->setQuery(array("TITLE" => $sTitleKey, "MESSAGE" => $sMsgKey, "HELP" => $sHelpFile)); $s .= " newWin = " . WYPopupWindowLink::sOpenWindowCode($oURL, "WebYepNotice", 400, 300, WY_POPWIN_TYPE_PLAIN) . ";\n"; $s .= " newWin.focus();"; $s .= "</script>\n"; } return $s; }
function sEditButtonHTML($sButtonImage = "edit-button.gif", $sToolTip = "", $oCustomEditURL = false) { global $goApp, $webyep_bShowDisabledEditButtons, $webyep_bOtherLoginsMayEditGlobalData; $oImgURL = od_nil; $oImg = od_nil; $oEditorURL = od_nil; $oNeedJSURL = od_nil; $dQuery = array(); $iEW = $iEH = 0; $sWCookie = $sHCookie = ""; $bUsesCustomURL = false; if ($this->bUserMayEditThisElement()) { if (!$sToolTip) { $sToolTip = sprintf(WYTS("editTheField"), $this->sName); } $oImgURL = od_clone($goApp->oImageURL); $oImgURL->addComponent($sButtonImage); $oImg = new WYImage($oImgURL); $oImg->setAttribute("border", 0); $oImg->setAttribute("alt", $sToolTip); if ($oCustomEditURL === false || $oCustomEditURL === od_nil) { $oEditorURL = od_clone($goApp->oProgramURL); $oEditorURL->addComponent("editors/" . $this->sEditorPageName); $dQuery = array_merge(WYEditor::dQueryForElement($this), $this->dEditorQuery); $oEditorURL->setQuery($dQuery); } else { $oEditorURL = $oCustomEditURL; $bUsesCustomURL = true; } $this->getSizeCookieNames($sWCookie, $sHCookie); if (isset($_COOKIE[$sWCookie])) { $iEW = (int) $_COOKIE[$sWCookie]; $iEH = (int) $_COOKIE[$sHCookie]; WYEditor::tranformSizeForOperation($iEW, $iEH, WY_EDITOR_OPEN); } else { $iEW = $this->iEditorWidth; $iEH = $this->iEditorHeight; } if ($bUsesCustomURL) { $oLink = new WYLink($oEditorURL, $sToolTip); $oLink->setInnerHTML($oImg->sDisplay()); $oLink->setAttribute("class", $this->sEditButtonCSSClass); return $oLink->sDisplay(); } else { $oWin = new WYPopupWindowLink($oEditorURL, "WebYepEditor" . mt_rand(1000, 9999), $iEW, $iEH, WY_POPWIN_TYPE_PLAIN); $oNeedJSURL = od_clone($goApp->oProgramURL); $oNeedJSURL->addComponent(WYTS("LogonURL")); $oWin->setAttribute("href", $oNeedJSURL->sEURL()); // special href: JS warning $oWin->setInnerHTML($oImg->sDisplay()); $oWin->setToolTip($sToolTip); $oWin->setAttribute("class", $this->sEditButtonCSSClass); return $oWin->sDisplay(); } } else { if ($webyep_bShowDisabledEditButtons) { $sToolTip = sprintf(WYTS("insufficientPermissions"), $this->sName); $oImgURL = od_clone($goApp->oImageURL); $oImgURL->addComponent("edit-button-disabled.gif"); $oImg = new WYImage($oImgURL); $oImg->setAttribute("border", 0); $oImg->setAttribute("alt", $sToolTip); $oLink = new WYLink(new WYURL("javascript:void(0);"), $sToolTip); $oLink->setInnerHTML($oImg->sDisplay()); $oLink->setAttribute("class", $this->sEditButtonCSSClass); return $oLink->sDisplay(); } else { return ""; } } }