예제 #1
1
파일: rich-text.php 프로젝트: bcneb/WebYep
} else {
    unset($oP);
    $oP = od_clone($goApp->oProgramPath);
    $oP->addComponent("opt");
    $oP->addComponent("rte");
    if ($oP->bExists()) {
        $oEditorsFolder->addComponent("rich-text-rte.php");
        include_once $oEditorsFolder->sPath;
    } else {
        unset($oP);
        $oP = od_clone($goApp->oProgramPath);
        $oP->addComponent("opt");
        $oP->addComponent("fckeditor");
        if ($oP->bExists()) {
            $oEditorsFolder->addComponent("rich-text-fckeditor.php");
            include_once $oEditorsFolder->sPath;
        } else {
            unset($oP);
            $oP = od_clone($goApp->oProgramPath);
            $oP->addComponent("opt");
            $oP->addComponent("ckeditor");
            if ($oP->bExists()) {
                $oEditorsFolder->addComponent("rich-text-ckeditor.php");
                include_once $oEditorsFolder->sPath;
            } else {
                $oEditorsFolder->addComponent("rich-text-plain.php");
                include_once $oEditorsFolder->sPath;
            }
        }
    }
}
예제 #2
1
 function sDisplay()
 {
     global $goApp;
     $s = "";
     $aEntries =& $this->dContent[WY_DK_GB_ENTRIES];
     $dEntry = array();
     $sName = $sEMail = $sMessage = $sClientIP = "";
     $iTime = $iID = 0;
     if ($goApp->sFormFieldValue(WY_QK_GB_MAGIC, "") == WY_QV_GB_MAGIC && ($sMessage = $goApp->sFormFieldValue(WY_QK_GB_MESSAGE, ""))) {
         // new message arrived
         $sName = $goApp->sFormFieldValue(WY_QK_GB_NAME, "");
         $sEMail = $goApp->sFormFieldValue(WY_QK_GB_EMAIL, "");
         if (!$this->bAddEntry($sName, $sEMail, $sMessage)) {
             $s .= sprintf("<script type=\"text/javascript\"> alert(\"%s\"); </script>", WYTS("IPIsBlocked"));
         }
     }
     if ($goApp->bEditMode) {
         if ($goApp->sCurrentAction() == WY_QV_GB_REMOVE) {
             $iID = $goApp->sFormFieldValue(WY_QK_GB_ID, 0);
             $this->removeEntry($iID);
         }
         if ($goApp->sCurrentAction() == WY_QV_GB_BLOCK) {
             $sIP = $goApp->sFormFieldValue(WY_QK_GB_IP, 0);
             $this->blockIP($sIP);
         }
         if ($goApp->sCurrentAction() == WY_QV_GB_UNBLOCK) {
             $sIP = $goApp->sFormFieldValue(WY_QK_GB_IP, 0);
             $this->unblockIP($sIP);
         }
     }
     foreach ($aEntries as $dEntry) {
         $sName = $dEntry[WY_DK_GB_NAME];
         $sEMail = $dEntry[WY_DK_GB_EMAIL];
         $sMessage = $dEntry[WY_DK_GB_MESSAGE];
         // backward comp.: check isset($dEntry[WY_DK_GB_IP])
         $sClientIP = isset($dEntry[WY_DK_GB_IP]) ? $dEntry[WY_DK_GB_IP] : "";
         $iTime = $dEntry[WY_DK_GB_TIME];
         $iID = $dEntry[WY_DK_GB_ID];
         $s .= "<div class='" . WY_GB_CSS_ALL . "'>";
         if ($goApp->bEditMode) {
             $oURL = od_clone(WYURL::oCurrentURL());
             $oImgURL = od_clone($goApp->oImageURL);
             $dEditorQuery = $this->dEditorQuery;
             $dEditorQuery[WY_QK_GB_ID] = $iID;
             $goApp->setActionInQuery($dEditorQuery, WY_QV_GB_REMOVE);
             $oURL->setQuery(array_merge($oURL->dQuery, $dEditorQuery));
             $oLink = new WYLink($oURL, WYTS("GuestbookRemoveButton"));
             $oImgURL->addComponent("remove-button.gif");
             $oImg = new WYImage($oImgURL);
             $oLink->setInnerHTML($oImg->sDisplay());
             $oLink->setAttribute("onclick", "return confirm(\"" . WYTS("GuestbookRemoveConfirm") . "\");");
             $s .= $oLink->sDisplay();
         }
         $s .= "<div>";
         if ($sName) {
             $s .= "<span class='" . WY_GB_CSS_NAME . "'>" . webyep_sHTMLEntities($sName) . "</span>";
         }
         if ($sEMail) {
             $s .= ($sName ? " " : "") . "<span class='" . WY_GB_CSS_EMAIL . "'>(" . $this->_sEMailLink($sEMail) . ")</span>";
         }
         if ($sName || $sEMail) {
             $s .= ", ";
         }
         $s .= "<span class='" . WY_GB_CSS_DATETIME . "'>" . WYTS("AtDate") . " " . sWYTDate($iTime) . " " . WYTS("AtTime") . " " . sWYTTime($iTime) . "</span>:</div>\n";
         if ($goApp->bEditMode) {
             $s .= "<div class='" . WY_GB_CSS_MESSAGE . "'>";
             $s .= WYTS("ClientIP") . ": ";
             $bIsBlocked = in_array($sClientIP, $this->dContent[WY_DK_GB_BLOCKED_IPS]);
             if ($sClientIP) {
                 if (!$bIsBlocked) {
                     $oURL = od_clone(WYURL::oCurrentURL());
                     $oImgURL = od_clone($goApp->oImageURL);
                     $dEditorQuery = $this->dEditorQuery;
                     $dEditorQuery[WY_QK_GB_IP] = $sClientIP;
                     $goApp->setActionInQuery($dEditorQuery, WY_QV_GB_BLOCK);
                     $oURL->setQuery($dEditorQuery);
                     $oLink = new WYLink($oURL, WYTS("GuestbookBlockButton"));
                     $oImgURL->addComponent("block-button.gif");
                     $oImg = new WYImage($oImgURL);
                     $oImg->setAttribute("style", "vertical-align: middle");
                     $oLink->setInnerHTML($oImg->sDisplay());
                     $oLink->setAttribute("onclick", "return confirm(\"" . WYTS("GuestbookBlockConfirm") . "\");");
                 }
                 $s .= $sClientIP;
                 if (!$bIsBlocked) {
                     $s .= "&nbsp;" . $oLink->sDisplay();
                 }
             } else {
                 $s .= WYTS("unknown");
             }
             $s .= "</div>\n";
         }
         // make content secure:
         $sMessage = str_replace("<", "", $sMessage);
         $sMessage = str_replace(">", "", $sMessage);
         $s .= "<div class='" . WY_GB_CSS_MESSAGE . "'>" . WYLongTextElement::_sFormatContent($sMessage, $this->bHideEMailAddresses) . "</div>";
         $s .= "</div>\n";
     }
     if ($goApp->bEditMode && count($this->dContent[WY_DK_GB_BLOCKED_IPS])) {
         unset($a);
         $a =& $this->dContent[WY_DK_GB_BLOCKED_IPS];
         $s .= "<div class='" . WY_GB_CSS_ALL . "'>";
         $s .= "<strong>" . WYTS("BlockedIPs") . ":</strong><br />\n";
         $oURL = od_clone(WYURL::oCurrentURL());
         $dEditorQuery = $this->dEditorQuery;
         $goApp->setActionInQuery($dEditorQuery, WY_QV_GB_UNBLOCK);
         $oURL->setQuery($dEditorQuery);
         $oImgURL = od_clone($goApp->oImageURL);
         $oImgURL->addComponent("unblock-button.gif");
         $oImg = new WYImage($oImgURL);
         $oImg->setAttribute("style", "vertical-align: middle");
         foreach ($a as $sIP) {
             $oURL->dQuery[WY_QK_GB_IP] = $sIP;
             $oLink = new WYLink($oURL, WYTS("GuestbookUnBlockButton"));
             $oLink->setInnerHTML($oImg->sDisplay());
             $oLink->setAttribute("onclick", "return confirm(\"" . WYTS("GuestbookUnBlockConfirm") . "\");");
             $s .= $sIP . "&nbsp;" . $oLink->sDisplay() . "<br />\n";
         }
         $s .= "</div>";
     }
     return $s;
 }
예제 #3
1
        if ($oOriginalName->bCheck(WYPATH_CHECK_NOSCRIPT | WYPATH_CHECK_NOPATH | WYPATH_CHECK_JUSTIMAGE)) {
            $sFilename = $oOriginalName->sPath;
            $sExtension = $oOriginalName->sExtension();
            $sFilename = str_replace(".{$sExtension}", "", $sFilename);
            $sFilename = WYPath::sMakeFilename($sFilename);
            $oDestPath = od_clone($goApp->oDataPath);
            $sDestFilename = "rtimg-{$sFilename}.{$sExtension}";
            $oDestPath->addComponent($sDestFilename);
            $oFile = new WYFile($oFU->oFilePath());
            if (!$oFile->bCopyTo($oDestPath)) {
                $goApp->log("Could not copy uploaded image file");
                $sResponse = WYTS("FileUploadErrorUnknown", false);
            } else {
                $sResponse = "";
                $bOK = true;
                $oURL = od_clone($goApp->oDataURL);
                $oURL->addComponent($sDestFilename);
                $sURL = $oURL->sURL(false, false, true);
            }
        } else {
            $goApp->log("Illegal file/type on attachment upload: " . $oOFP->sPath);
            $sResponse = WYTS("FileUploadErrorUnknown", false);
        }
        $oFU->deleteTmpFile();
    } else {
        $sResponse = $oFU->sErrorMessage(false);
    }
} else {
    if (isset($_GET[WY_QK_POST_MAX_CHECK])) {
        $sResponse = WYTS("FileUploadErrorSize", false);
    }
예제 #4
0
 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;
 }
예제 #5
0
파일: WYFile.php 프로젝트: bcneb/WebYep
 function WYFile(&$oP)
 {
     global $goApp;
     $this->oPath = od_clone($oP);
     // we only act on files inside a webyep-system folder:
     if (strpos($this->oPath->sPath, "webyep-system") === false) {
         $goApp->log("WYFile abuse - trying to access path " . $this->oPath->sPath);
         $this->oPath = od_nil;
     }
     $this->sContent = false;
     $this->iWriteMode = WYFILE_WRITE_ATOMIC;
 }
예제 #6
0
 function sDisplay()
 {
     global $goApp, $webyep_sProductName;
     $s = "";
     $oImg = od_nil;
     $oLink = od_nil;
     $oImgURL = od_clone($goApp->oImageURL);
     $oPageURL = od_clone(WYURL::oCurrentURL());
     $oNoticeURL = od_clone($goApp->oProgramURL);
     unset($oPageURL->dQuery[WY_QK_LOGOUT]);
     $oNoticeURL->addComponent(WYTS("LogonURL"));
     if (!$goApp->bEditMode) {
         if ($this->bVisible) {
             $oImgURL->addComponent("logon-button.gif");
             $oImg = new WYImage($oImgURL);
         } else {
             $oImgURL->addComponent("nix.gif");
             $oImg = new WYImage($oImgURL);
             $oImg->setAttribute("width", 16);
             $oImg->setAttribute("height", 16);
         }
         $oImg->setAttribute("style", "border: none");
         $oImg->setAttribute("alt", WYTS("WebYepLogon"));
         $oLink = new WYLink($oNoticeURL);
         if ($goApp->bValidUser()) {
             $oPageURL->dQuery[WY_QK_EDITMODE] = "yes" . mt_rand(1000, 9999);
             $oLink->setAttribute("onclick", "document.location=\"" . $oPageURL->sEURL() . "\"; return false;");
         } else {
             $oLink->setAttribute("onclick", webyep_sHTMLEntities($goApp->sAuthWindowJS()) . "; return false;");
         }
         $oLink->setInnerHTML($oImg->sDisplay());
         $sToolTip = WYTS("LogonButton");
         $sToolTip = str_replace("WebYep", $webyep_sProductName, $sToolTip);
         $oLink->setToolTip($sToolTip);
         $s = $oLink->sDisplay();
     } else {
         $oImgURL->addComponent("logoff-button.gif");
         $oImg = new WYImage($oImgURL);
         $oImg->setAttribute("style", "border: none");
         $oImg->setAttribute("alt", WYTS("LogoffButton"));
         $oPageURL->dQuery[WY_QK_EDITMODE] = "no" . mt_rand(1000, 9999);
         $oLink = new WYLink($oPageURL);
         $oLink->setInnerHTML($oImg->sDisplay());
         $oLink->setToolTip(WYTS("LogoffButton"));
         $oLink->setAttribute("onclick", "if (event.shiftKey || event.altKey) this.href += \"&" . WY_QK_LOGOUT . "=1\"; return true;");
         $s = $oLink->sDisplay();
     }
     return $s;
 }
예제 #7
0
 function WYFileUpload($sN, $multiple = false)
 {
     global $goApp;
     parent::WYHTMLTag("input");
     $this->dAttributes["type"] = "file";
     if ($multiple) {
         $this->dAttributes["name"] = $sN . '[]';
         $this->dAttributes["multiple"] = "multiple";
     } else {
         $this->dAttributes["name"] = $sN;
     }
     $this->dFileInfos = od_nil;
     if (isset($_FILES[$sN])) {
         $this->dFileInfos = $_FILES[$sN];
         // how many files?
         if (is_array($this->dFileInfos["name"])) {
             $this->iNrOfFiles = count($this->dFileInfos["name"]);
         } else {
             $this->iNrOfFiles = 1;
             $tmpFI = array("name" => array($this->dFileInfos["name"]), "type" => array($this->dFileInfos["type"]), "tmp_name" => array($this->dFileInfos["tmp_name"]), "error" => array($this->dFileInfos["error"]), "size" => array($this->dFileInfos["size"]));
             $this->dFileInfos = $tmpFI;
             $tmpFI = NULL;
         }
         for ($i = 0; $i < $this->iNrOfFiles; $i++) {
             // security check
             $sOFN = isset($this->dFileInfos["name"][$i]) ? $this->dFileInfos["name"][$i] : "";
             $oOFN = new WYPath($sOFN);
             if (!$oOFN->bCheck(WYPATH_CHECK_NOSCRIPT | WYPATH_CHECK_NOPATH)) {
                 $goApp->log("error on file upload: illegal file type/name <{$sOFN}>");
                 @unlink($this->dFileInfos["tmp_name"][$j]);
                 // delete evil uploaded file
             } else {
                 if ($this->bFileUploaded($i) && $this->bUploadOK($i)) {
                     $oTmpPath = new WYPath($this->dFileInfos["tmp_name"][$i]);
                     $oToPath = od_clone($goApp->oDataPath);
                     $oToPath->addComponent($oTmpPath->sBasename());
                     if (!$goApp->move_uploaded_file($oTmpPath, $oToPath)) {
                         $goApp->log("WYFileUpload: Could not move uploaded file " . $oTmpPath->sPath . " to " . $oToPath->sPath);
                     } else {
                         $this->dFileInfos["tmp_name"][$i] = $oToPath->sPath;
                     }
                 } else {
                     $goApp->log("error on file upload: " . $this->iErrorCode() . ": " . $this->sErrorMessage());
                 }
             }
         }
     }
 }
예제 #8
0
파일: foundation.php 프로젝트: bcneb/WebYep
function webyep_bHasFilemanager()
{
    global $goApp;
    $oOptPath = od_clone($goApp->oProgramPath);
    $oOptPath->addComponent("opt");
    $aFileManagers = array('ckfinder', 'filemanager', 'tinymce/jscripts/tiny_mce/plugins/imagemanager');
    foreach ($aFileManagers as $fileManager) {
        $oOptPath->addComponent($fileManager);
        if ($oOptPath->bExists()) {
            return true;
        } else {
            $oOptPath->removeLastComponent();
        }
    }
    return false;
}
예제 #9
0
function sTinyMCELang()
{
    global $webyep_iLanguageID;
    global $goApp;
    switch ($webyep_iLanguageID) {
        case WYLANG_GERMAN:
            $sL = "de";
            break;
        case WYLANG_SRPSKI:
            $sL = "sr";
            break;
        case WYLANG_POLISH:
            $sL = "pl";
            break;
        case WYLANG_PORTUGUESE:
            $sL = "pt";
            break;
        case WYLANG_SWEDISH:
            $sL = "sv";
            break;
        case WYLANG_DUTCH:
            $sL = "nl";
            break;
        case WYLANG_FRENCH:
            $sL = "fr";
            break;
            // case WYLANG_HUNGARIAN: $sL = "hu"; break;
        // case WYLANG_HUNGARIAN: $sL = "hu"; break;
        default:
            $sL = "en";
            break;
    }
    if ($sL != "en") {
        $oP = od_clone($goApp->oProgramPath);
        $oP->addComponent("opt");
        $oP->addComponent("tinymce");
        $oP->addComponent("jscripts");
        $oP->addComponent("tiny_mce");
        $oP->addComponent("langs");
        $oP->addComponent("{$sL}.js");
        if (!$oP->bExists()) {
            $sL = "en";
        }
    }
    return $sL;
}
예제 #10
0
 function showEditButtons()
 {
     global $goApp, $webyep_bShowDisabledEditButtons, $webyep_bOtherLoginsMayEditGlobalData;
     if ($goApp->bEditMode) {
         if ($this->iEditedID == $this->iLoopID) {
             $this->showAnchor();
         }
         if ($this->bUserMayEditThisElement()) {
             $oURL = od_clone(WYURL::oCurrentURL());
             unset($oURL->dQuery[WY_QK_LOOP_ADD_ABOVE]);
             $oLink = od_nil;
             $oImg = od_nil;
             $oImgURL = od_clone($goApp->oImageURL);
             $dEditQuery = WYEditor::dQueryForElement($this);
             $aLoopIDs = $this->_aLoopIDs();
             $iCount = count($aLoopIDs);
             $dEditQuery[WY_QK_LOOP_ID] = $this->iCurrentLoopID();
             $goApp->setActionInQuery($dEditQuery, WY_QV_LOOP_ADD);
             $oURL->setQuery(array_merge($oURL->dQuery, $dEditQuery));
             $oURL->sAnchor = "WEBYEP_CURRENT_LOOP_ITEM";
             $oLink = new WYLink($oURL, WYTS("LoopAddButton"));
             $oImgURL->addComponent("add-button.gif");
             $oImg = new WYImage($oImgURL);
             $oImg->setAttribute("style", "border: none");
             $oImg->setAttribute("alt", WYTS("LoopAddButton"));
             $oLink->setInnerHTML($oImg->sDisplay());
             $oLink->setAttribute("class", "WebYepLoopAddButton");
             $oLink->setAttribute("onclick", "webyep_loopAddBlockAboveBelow(this); return true;");
             echo $oLink->sDisplay();
             if ($iCount > 1) {
                 $dEditQuery = $oURL->dQuery;
                 $goApp->setActionInQuery($dEditQuery, WY_QV_LOOP_REMOVE);
                 $oURL->setQuery($dEditQuery);
                 $oLink = new WYLink($oURL, WYTS("LoopRemoveButton"));
                 $oImgURL->removeLastComponent();
                 $oImgURL->addComponent("remove-button.gif");
                 $oImg = new WYImage($oImgURL);
                 $oImg->setAttribute("style", "border: none");
                 $oImg->setAttribute("alt", WYTS("LoopRemoveButton"));
                 $oLink->setInnerHTML($oImg->sDisplay());
                 $oLink->setAttribute("onclick", "return confirm(\"" . WYTS("LoopRemoveConfirm") . "\");");
                 $oLink->setAttribute("class", "WebYepLoopRemoveButton");
                 echo $oLink->sDisplay();
                 $oLink->removeAttribute("onclick");
                 $goApp->setActionInQuery($dEditQuery, WY_QV_LOOP_UP);
                 $oURL->setQuery($dEditQuery);
                 $oLink = new WYLink($oURL, WYTS("LoopUpButton"));
                 $oImgURL->removeLastComponent();
                 $oImgURL->addComponent("up-button.gif");
                 $oImg = new WYImage($oImgURL);
                 $oImg->setAttribute("style", "border: none");
                 $oImg->setAttribute("alt", WYTS("LoopUpButton"));
                 $oLink->setInnerHTML($oImg->sDisplay());
                 $oLink->setAttribute("class", "WebYepLoopUpButton");
                 echo $oLink->sDisplay();
                 $goApp->setActionInQuery($dEditQuery, WY_QV_LOOP_DOWN);
                 $oURL->setQuery($dEditQuery);
                 $oLink = new WYLink($oURL, WYTS("LoopDownButton"));
                 $oImgURL->removeLastComponent();
                 $oImgURL->addComponent("down-button.gif");
                 $oImg = new WYImage($oImgURL);
                 $oImg->setAttribute("style", "border: none");
                 $oImg->setAttribute("alt", WYTS("LoopDownButton"));
                 $oLink->setInnerHTML($oImg->sDisplay());
                 $oLink->setAttribute("class", "WebYepLoopDownButton");
                 echo $oLink->sDisplay();
             }
             if ($this->bIDIsDisabled($this->iCurrentLoopID())) {
                 $goApp->setActionInQuery($dEditQuery, WY_QV_LOOP_ENABLE);
                 $oURL->setQuery($dEditQuery);
                 $oLink = new WYLink($oURL, WYTS("LoopEnableButton"));
                 $oImgURL->removeLastComponent();
                 $oImgURL->addComponent("enable-button.gif");
                 $oImg = new WYImage($oImgURL);
                 $oImg->setAttribute("style", "border: none");
                 $oImg->setAttribute("alt", WYTS("LoopEnableButton"));
                 $oLink->setInnerHTML($oImg->sDisplay());
                 $oLink->setAttribute("class", "WebYepLoopEnabledButton");
                 echo $oLink->sDisplay();
             } else {
                 $goApp->setActionInQuery($dEditQuery, WY_QV_LOOP_DISABLE);
                 $oURL->setQuery($dEditQuery);
                 $oLink = new WYLink($oURL, WYTS("LoopDisableButton"));
                 $oImgURL->removeLastComponent();
                 $oImgURL->addComponent("disable-button.gif");
                 $oImg = new WYImage($oImgURL);
                 $oImg->setAttribute("style", "border: none");
                 $oImg->setAttribute("alt", WYTS("LoopDisableButton"));
                 $oLink->setInnerHTML($oImg->sDisplay());
                 $oLink->setAttribute("class", "WebYepLoopEnabledButton");
                 echo $oLink->sDisplay();
             }
         } else {
             // editing now allowed
             if ($webyep_bShowDisabledEditButtons) {
                 $sToolTip = sprintf(WYTS("insufficientPermissions"), $this->sName);
                 $oImgURL = od_clone($goApp->oImageURL);
                 $oImgURL->addComponent("loop-buttons-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);
                 echo $oLink->sDisplay();
             }
         }
     }
 }
예제 #11
0
파일: WYElement.php 프로젝트: bcneb/WebYep
 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 "";
         }
     }
 }
예제 #12
0
</h1></td>
        <td align="right"><img src="../images/logo.gif"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><?php 
if (!$bDidSave) {
    ?>
      <table border="0" cellspacing="0" cellpadding="6" style="height: 95%; width: 100%;">
        <tr>
          <td align="left" valign="top" class="FCKEditorCell">
<?php 
    $oFCKeditor = new FCKeditor('FCKeditor1');
    $oFCKeditor->BasePath = $oFCKBaseURL->sURL(false, false, true) . "/";
    $oInitCodePath = od_clone($goApp->oProgramPath);
    $oInitCodePath->addComponent("opt");
    $oInitCodePath->addComponent("fckeditor_init.php");
    $oFCKeditor->Config['EditorAreaCSS'] = $sCSSURL;
    $oFCKeditor->Config['ToolbarComboPreviewCSS'] = $sCSSURL;
    if ($oInitCodePath->bExists()) {
        include_once $oInitCodePath->sPath;
    } else {
        $oFCKeditor->Config['AutoDetectLanguage'] = true;
        $oFCKeditor->Config['DefaultLanguage'] = 'en';
        $oFCKeditor->Config['StartupFocus'] = true;
        $oFCKeditor->Config['AutoDetectPasteFromWord'] = true;
    }
    $oFCKeditor->Width = "100%";
    $oFCKeditor->Height = "100%";
    $oFCKeditor->Value = $sContent;
예제 #13
0
 /**
  * Liefert den HTML-Code für das GalleryElement
  *
  * Diese Methode liefert den HTML-Code, der das GalleryElement in der Webseite darstellt.
  * Folgende globale Variablen beeinflussen die Arbeitsweise:
  * - $goApp										das globale Application-Objekt (gibt Auskunft über EditMode J/N, Programmpfad, Datenpfad)
  * - $webyep_bUseTablesForGalleries    sollen Tablellen oder DIVs für die Gallerie verwendet werden?
  * - $webyep_iUseImageBox					wird eine JavaScript-Anwendung zur Anzeige der Bilder verwendet?
  * - $webyep_sLiveDemoSlotID				TODO description
  *
  *	@return		string		HTML-Code des GalleryElement
  */
 function sDisplay()
 {
     global $goApp, $webyep_bUseTablesForGalleries, $webyep_iUseImageBox, $webyep_sLiveDemoSlotID;
     $sHTML = "";
     $iCount = count($this->_aItems());
     $i = 0;
     $iCols = $this->iCols;
     $bEditMode = $goApp->bEditMode;
     $sTNName = "";
     $oTN = $oLink = $oDetailURL = od_nil;
     $sText = $sFilename = "";
     $sBoxName = $this->sDataFileName(false);
     if ($iCount == 0 && !$bEditMode) {
         return "";
     }
     if ($webyep_iUseImageBox == WEBYEP_NOBOX) {
         $oDetailURL = od_clone($goApp->oProgramURL);
         $oDetailURL->addComponent("image-detail.php");
     }
     $sHTML .= $webyep_bUseTablesForGalleries ? sprintf("<table class=\"%s\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n", WY_GALLERY_CSS_CONTAINER) : sprintf("<div class=\"%s\">\n", WY_GALLERY_CSS_CONTAINER);
     while ($i < $iCount || $iCount == 0 && $i == 0 && $bEditMode || $i % $iCols) {
         // new row?
         if (!($i % $iCols)) {
             $sHTML .= $webyep_bUseTablesForGalleries ? sprintf("   <tr%s>\n", $i < $iCols ? " class=\"" . WY_GALLERY_CSS_FIRSTROW . "\"" : "") : sprintf("   <div style=\"overflow: hidden; zoom: 1.0\" class=\"%s%s\">\n", WY_GALLERY_CSS_ROW, $i < $iCols ? " " . WY_GALLERY_CSS_FIRSTROW : "");
         }
         $sHTML .= $webyep_bUseTablesForGalleries ? sprintf("      <td style=\"width: %dpx\"%s>", $this->iCellWidth, $i % $iCols == 0 ? " class=\"" . WY_GALLERY_CSS_FIRSTCOLUMN . "\"" : "") : sprintf("      <div style=\"float: left; width: %dpx\" class=\"%s%s\">", $this->iCellWidth, WY_GALLERY_CSS_CELL, $i % $iCols == 0 ? " " . WY_GALLERY_CSS_FIRSTCOLUMN : "");
         if ($i < $iCount) {
             $sHTML .= sprintf("<div class=\"%s\">", WY_GALLERY_CSS_IMAGE);
             $sFilename = $this->sFilenameForID($i);
             $sText = $this->sTextForID($i);
             if ($sFilename) {
                 $oTN =& $this->_oTNImage($sFilename);
                 unset($oLink);
                 if ($webyep_iUseImageBox == WEBYEP_LIGHTBOX) {
                     unset($oImgURL);
                     $oImgURL = od_clone($goApp->oDataURL);
                     $oImgURL->addComponent($sFilename);
                     if ($webyep_sLiveDemoSlotID) {
                         $oImg = new WYImage($oImgURL);
                         if (!$oImg->bExists()) {
                             $oImgURL->removeDemoSlotID();
                         }
                     }
                     $oLink = new WYLink($oImgURL, $sText ? $this->sStripFormatting($sText) : " ");
                     $oLink->setAttribute("rel", "lightbox[{$sBoxName}]");
                     $oLink->sInnerHTML = $oTN->sDisplay();
                     $sHTML .= $oLink->sDisplay();
                 } else {
                     if ($webyep_iUseImageBox == WEBYEP_FANCYBOX) {
                         unset($oImgURL);
                         $oImgURL = od_clone($goApp->oDataURL);
                         $oImgURL->addComponent($sFilename);
                         if ($webyep_sLiveDemoSlotID) {
                             $oImg = new WYImage($oImgURL);
                             if (!$oImg->bExists()) {
                                 $oImgURL->removeDemoSlotID();
                             }
                         }
                         $oLink = new WYLink($oImgURL, $sText ? $this->sStripFormatting($sText) : " ");
                         $oLink->setAttribute("rel", "fancybox_{$sBoxName}");
                         $oLink->setAttribute("class", "WYPopUpImage");
                         $oLink->sInnerHTML = $oTN->sDisplay();
                         $sHTML .= $oLink->sDisplay();
                     } else {
                         $oDetailURL->dQuery[WY_QK_IMAGE_DETAIL] = $sFilename;
                         $oDetailURL->dQuery[WY_QK_IMAGE_ALTTEXT] = $this->sStripFormatting($sText);
                         $oDetailURL->dQuery[WY_QK_IMAGE_DEMOCONTENT] = $this->bDemoContent;
                         $oLink = new WYLink(new WYURL("javascript:void(0)"));
                         $oLink->setAttribute("onclick", sprintf("wydw=window.open(\"%s\", \"WYDetail\", \"width=%d,height=%d,status=yes,scrollbars=no,resizable=yes\"); wydw.focus();", $oDetailURL->sEURL(true, true, true), $this->iImageWidth, $this->iImageHeight));
                         $oLink->setToolTip(WYTS("ClickToZoom"));
                         $oLink->sInnerHTML = $oTN->sDisplay();
                         $sHTML .= $oLink->sDisplay();
                     }
                 }
             } else {
                 if ($bEditMode) {
                     $sHTML .= WYTS("GalleryNoImage");
                 }
             }
             $sHTML .= "</div>";
         }
         if ($bEditMode && ($i < $iCount || $i == 0)) {
             $sHTML .= "\n<div>";
             $sHTML .= $this->_sEditButtons($i < $iCount ? $i : -1);
             $sHTML .= "</div>";
         }
         if ($i < $iCount) {
             if ($sText) {
                 $sHTML .= sprintf("<div class=\"%s\">", WY_GALLERY_CSS_TEXT);
                 // $sHTML .= webyep_sHTMLEntities($sText);
                 $sHTML .= WYLongTextElement::_sFormatContent($sText, true);
                 $sHTML .= "</div>";
             }
         }
         $sHTML .= $webyep_bUseTablesForGalleries ? "</td>\n" : "</div>\n";
         // /WY_GALLERY_CSS_CELL
         $i++;
         if (!($i % $iCols)) {
             $sHTML .= $webyep_bUseTablesForGalleries ? "   </tr>\n" : "   </div>\n";
         }
         // WY_GALLERY_CSS_ROW
     }
     $sHTML .= $webyep_bUseTablesForGalleries ? "</table>\n" : "</div>\n";
     // /WY_GALLERY_CSS_CONTAINER
     return $sHTML;
 }
예제 #14
0
 function sDisplay()
 {
     global $goApp;
     $sHTML = "";
     $sFN = $this->sDownloadFileName();
     $oURL = $oLink = od_nil;
     if ($sFN) {
         $oURL = od_clone($goApp->oProgramURL);
         $oURL->addComponent("download.php");
         $oURL->dQuery[WY_QK_DOWNLOAD_FILENAME] = $sFN;
         $oURL->dQuery[WY_QK_ORIGINAL_FILENAME] = $this->sOriginalFilename();
         $oLink = new WYLink($oURL, WYTS("DownloadHint"));
         if ($this->sCustomIcon) {
             $oImg = new WYImage(new WYURL($this->sCustomIcon));
             $oImg->setAttribute("class", WY_ATTACHMENT_CSS_ICON);
             $oLink->setInnerHTML($this->sOriginalFilename() . "&nbsp;" . $oImg->sDisplay());
         } else {
             $oLink->setInnerHTML($this->sOriginalFilename());
         }
         $sHTML .= $oLink->sDisplay();
     }
     return $sHTML;
 }
예제 #15
0
파일: info-pt.php 프로젝트: bcneb/WebYep
  top[winName] = window.open(theURL,winName,features);
  setTimeout("top['" + winName + "'].focus();", 250);
}
//-->
</script>
</head>
<?php 
// WebYep
// (C) Objective Development Software GmbH
// http://www.obdev.at
$bPermOK = false;
$oP = od_nil;
$oF = od_nil;
srand((double) microtime() * 1000000);
$sFilename = "permission-test" . mt_rand(1000, 9999);
$oP = od_clone($goApp->oDataPath);
$oP->addComponent($sFilename);
$oF = new WYFile($oP);
$oF->setContent("write test");
$bPermOK = $oF->bWrite();
@$oF->bDelete();
?>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td class="pageTitle" align="left" valign="middle">WebYep System Infos</td>
    <td align="right" valign="top"><a href="http://www.obdev.at/webyep/" target="_blank"><img src="program/images/logo.gif" align="top" border="0" alt="WebYep WebSite"></a></td>
  </tr>
</table>
<hr size="1" noshade>
<h2>Installed WebYep-Version</h2>
예제 #16
0
파일: WYLanguage.php 프로젝트: bcneb/WebYep
 function setup()
 {
     global $webyep_iLanguageID, $webyep_dLanguageStrings, $webyep_sLang, $goApp;
     $oLangFile = od_nil;
     $aLines = array();
     $iLineCount = 0;
     $sLine = "";
     $sKey = "";
     $oP = od_clone($goApp->oProgramPath);
     $oP->addComponent("lstrings.dat");
     $oLangFile = new WYFile($oP);
     $aLines = $oLangFile->aContentLines();
     $iLineCount = count($aLines);
     for ($i = 0; $i < $iLineCount; $i++) {
         $sLine = $aLines[$i];
         if (substr(trim($sLine), 0, 2) == "/*") {
             continue;
         }
         if (!$sKey && $sLine) {
             $sKey = $sLine;
         } else {
             if ($sLine) {
                 $webyep_dLanguageStrings[$sKey][] = $sLine;
             } else {
                 $sKey = "";
             }
         }
     }
     $webyep_sLang = strtolower($webyep_sLang);
     if ($webyep_sLang == "" || $webyep_sLang == "auto") {
         // tetermine language: for now by looking at the spelling of the program folder
         if (strstr(WYApplication::sScriptPath(__FILE__), "/programm/lib/WYLanguage")) {
             $webyep_iLanguageID = WYLANG_GERMAN;
         } else {
             if (strstr(WYApplication::sScriptPath(__FILE__), "/program/lib/WYLanguage")) {
                 $webyep_iLanguageID = WYLANG_ENGLISH;
             } else {
                 $goApp->fatalError("Could not tetermine language");
             }
         }
     } else {
         if ($webyep_sLang == "srpski") {
             $webyep_iLanguageID = WYLANG_SRPSKI;
         } else {
             if ($webyep_sLang == "polski") {
                 $webyep_iLanguageID = WYLANG_POLISH;
             } else {
                 if ($webyep_sLang == "swedish") {
                     $webyep_iLanguageID = WYLANG_SWEDISH;
                 } else {
                     if ($webyep_sLang == "portuguese") {
                         $webyep_iLanguageID = WYLANG_PORTUGUESE;
                     } else {
                         if ($webyep_sLang == "swedish") {
                             $webyep_iLanguageID = WYLANG_SWEDISH;
                         } else {
                             if ($webyep_sLang == "dutch") {
                                 $webyep_iLanguageID = WYLANG_DUTCH;
                             } else {
                                 if ($webyep_sLang == "french") {
                                     $webyep_iLanguageID = WYLANG_FRENCH;
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     if (isset($GLOBALS["webyep_iForcedLanguageID"])) {
         $webyep_iLanguageID = $GLOBALS["webyep_iForcedLanguageID"];
         $goApp->log("forced language ID to: {$webyep_iLanguageID}");
     }
 }
예제 #17
0
파일: WYImage.php 프로젝트: bcneb/WebYep
 function oPath()
 {
     global $goApp;
     $oP = od_clone($goApp->oDocumentRoot());
     $sURL = $this->oURL->sURL();
     if ($oP) {
         $sURL = substr($sURL, 1);
         // remove leading "/"
         $oP->addComponent($sURL);
     }
     // workaround for webyep if DOCUMENT_ROOT fails
     if ((!$oP || !$oP->bExists()) && strstr($sURL, 'webyep-system/')) {
         $sURL = preg_replace('|^.*webyep-system/|', '', $sURL);
         $oP = od_clone($goApp->oProgramPath);
         $oP->removeLastComponent();
         $oP->addComponent($sURL);
     }
     return $oP;
 }
예제 #18
0
 function sDisplay()
 {
     global $goApp, $webyep_bOpenFullURLsInNewWindow, $webyep_iUseImageBox, $webyep_oCurrentLoop;
     $sHTML = "";
     $oImg = od_clone($this->oImage());
     $sAltText = $this->sAltText();
     $sAtt = "";
     $sAnchor = "";
     $iLoop = 0;
     $oURL = od_nil;
     $iDW = $this->bIsThumb ? $this->iThumbWidth : $this->iImageWidth;
     $iDH = $this->bIsThumb ? $this->iThumbHeight : $this->iImageHeight;
     if ($oImg) {
         if ($iDW != 0 || $iDH != 0) {
             $iW = $oImg->iWidth();
             $iH = $oImg->iHeight();
             if ($iW != 0 && $iH != 0) {
                 // if image size could be determined
                 if ($iW > $iDW || $iH > $iDH) {
                     // image has not the correct size
                     list($iW, $iH) = $this->aContrainedSize($iW, $iH, $this->bIsThumb);
                     $this->sAttributes .= ($this->sAttributes ? " " : "") . "width=\"{$iW}\" height=\"{$iH}\"";
                 }
             }
         }
         if ($this->sAttributes) {
             if (stristr($this->sAttributes, "width=") || stristr($this->sAttributes, "height=")) {
                 // width or height can only be set in attributes if $this->iImageWidth/iThumbWidth are _not_ used!
                 $oImg->removeAttribute("width");
                 $oImg->removeAttribute("height");
             }
             if (stristr($this->sAttributes, "alt=")) {
                 $oImg->removeAttribute("alt");
             }
         }
         if ($this->sAttributes) {
             $sAtt = " " . $this->sAttributes;
         }
         if ($sAltText) {
             $oImg->setAttribute("alt", $sAltText);
         }
         $sHTML .= str_replace("<img", "<img{$sAtt}", $oImg->sDisplay());
         $oLink = od_nil;
         $sURL = $this->dContent[WY_DK_URL] ? $this->dContent[WY_DK_URL] : $this->sURL;
         if ($sURL) {
             $oURL = new WYURL($sURL);
             if (!$this->dContent[WY_DK_URL]) {
                 $iLoop = $goApp->oDocument->iLoopID();
                 if ($iLoop) {
                     $oURL->dQuery[WY_QK_DI] = $goApp->oDocument->iDocumentInstanceForLoopID($iLoop);
                 }
             }
             $oLink = new WYLink($oURL, "", true);
             if ($webyep_bOpenFullURLsInNewWindow && WYURL::bIsAbsolute($sURL)) {
                 $this->sTarget = "_blank";
             }
             if ($this->sTarget) {
                 $oLink->setAttribute("target", $this->sTarget);
             }
         }
         if ($this->bIsThumb && !$oLink) {
             if ($webyep_iUseImageBox == WEBYEP_LIGHTBOX) {
                 $oImg = $this->oDetailImage();
                 $oURL = $oImg->oURL;
                 if (!$oLink) {
                     $oLink = new WYLink($oURL);
                     if ($webyep_oCurrentLoop != od_nil) {
                         $sGroup = $webyep_oCurrentLoop->sFieldNameForFile();
                     } else {
                         $sGroup = "";
                     }
                     $oLink->setAttribute("rel", "lightbox" . ($sGroup ? "[{$sGroup}]" : ""));
                     $oLink->setAttribute("class", "WYPopUpImage");
                 }
             } else {
                 if ($webyep_iUseImageBox == WEBYEP_FANCYBOX) {
                     // use jquery.fancybox
                     $oImg = $this->oDetailImage();
                     $oURL = $oImg->oURL;
                     if (!$oLink) {
                         $oLink = new WYLink($oURL);
                         if ($webyep_oCurrentLoop != od_nil) {
                             $sGroup = $webyep_oCurrentLoop->sFieldNameForFile();
                         } else {
                             $sGroup = md5($oURL->sEURL());
                         }
                         // 'unique' ID to prevent Fancybox from grouping single pictures
                         $oLink->setAttribute("rel", "fancybox" . ($sGroup ? "_{$sGroup}" : ""));
                         $oLink->setAttribute("class", "WYPopUpImage");
                     }
                 } else {
                     $oURL = $this->oDetailWindowURL();
                     $oImg = $this->oDetailImage();
                     $iW = $oImg->iWidth();
                     $iH = $oImg->iHeight();
                     if ($iW == 0) {
                         $iW = 400;
                     }
                     if ($iH == 0) {
                         $iH = 400;
                     }
                     $oURL->dQuery[WY_QK_IMAGE_DETAIL] = $oImg->oURL->sBasename();
                     $oURL->dQuery[WY_QK_IMAGE_ALTTEXT] = $sAltText;
                     $oURL->dQuery[WY_QK_IMAGE_DEMOCONTENT] = $this->bDemoContent;
                     if (!$oLink) {
                         $oLink = new WYLink(new WYURL("javascript:void(0)"));
                     }
                     $oLink->setAttribute("onclick", sprintf("wydw=window.open(\"%s\", \"WYDetail\", \"width=%d,height=%d,status=yes,scrollbars=yes,resizable=yes\"); wydw.focus();", $oURL->sEURL(true, true, true), $iW, $iH));
                     $oLink->setAttribute("class", "WYPopUpImage");
                     if (!$sAltText) {
                         $oLink->setToolTip(WYTS("ClickToZoom"));
                     }
                 }
             }
         }
         if ($oLink) {
             // $oLink->setAttribute("class", "WYPopUpImage");
             if ($sAltText) {
                 $oLink->setToolTip($sAltText);
             }
             $oLink->setInnerHTML($sHTML);
             $sHTML = $oLink->sDisplay();
         }
     }
     return $sHTML;
 }
예제 #19
0
파일: WYEditor.php 프로젝트: bcneb/WebYep
 function oEditedPagesPath()
 {
     global $goApp, $webyep_bOtherLoginsMayEditGlobalData;
     $oPath = od_nil;
     if ((int) $goApp->sFormFieldValue(WY_QK_EDITOR_GLOBAL) == 0 || $webyep_bOtherLoginsMayEditGlobalData || $goApp->bMainUser()) {
         $iPageID = (int) $goApp->sFormFieldValue(WY_QK_PAGEID);
         if ($iPageID) {
             $oPath = WYDocument::oPathForDocumentWithID($iPageID);
         }
     }
     return od_clone($oPath);
 }
예제 #20
0
파일: WYDocument.php 프로젝트: bcneb/WebYep
 function iPageIDForDocumentPath($oP, &$iMaxID)
 {
     $aLines = array();
     $sFileContent = "";
     $sDocPath = "";
     $iDocID = 0;
     $iPos = 0;
     $sLine = "";
     $iID = 0;
     $oDocFilePath = od_clone($this->oDocumentsFilePath());
     $oF = new WYFile($oDocFilePath);
     $iMaxID = 0;
     if ($oF->bExists()) {
         $aLines = $oF->aContentLines();
     }
     foreach ($aLines as $sLine) {
         $dEntry = $this->dParseDocumentsFileLine($sLine);
         if ($dEntry['id']) {
             $sDocPath = $dEntry['path'];
             $iDocID = $dEntry['id'];
             $iMaxID = max($iMaxID, $iDocID);
             if ($sDocPath == $oP->sPath) {
                 $iID = $iDocID;
                 break;
             }
         }
     }
     return $iID;
 }
예제 #21
0
 /**
  * Recursive function to build an HTML tree from a nested dictionary (v2)
  *
  * @param  mixed  $subtree The (nested) dictionary, containing the menu data
  * @return string          Nested list (HTML)
  */
 function buildHtmlTree($subtree)
 {
     global $goApp, $webyep_iMenuID, $webyep_bUseJavaScriptMenus, $webyep_bMenuJSInserted, $webyep_bAutoCloseMenus, $webyep_bOpenFullURLsInNewWindow, $webyep_bTitleAlwaysOpensPage;
     $sElementID = "WYMUTREE_{$webyep_iMenuID}_" . $this->iLastTitleID;
     if ($this->iLastTitleID != 0 && !in_array($this->iLastTitleID, $this->aCurrentPath) && !in_array($sElementID, $this->aOpenTrees)) {
         $this->aCloseTrees[] = $this->iLastTitleID;
     }
     if ($this->iLastTitleID == 0) {
         // first ul doesn't get an ID
         $sHTML = "\n<" . $this->sListType . ' class="' . WEBYEP_MENU_CSS . "\">\n";
     } else {
         $sHTML = "\n<" . $this->sListType . ' class="' . WEBYEP_MENU_CSS . " WYMUTREE_{$webyep_iMenuID}\" id=\"{$sElementID}\">\n";
     }
     $iEntryNr = 0;
     foreach ($subtree as $dEntry) {
         $iEntryNr++;
         $aClass = array(WEBYEP_MENU_CSS_ITEM);
         $bIsTitle = count($dEntry['SUBITEMS']) ? true : false;
         $bUseTitleAsItem = false;
         $bIsCurrentEntry = false;
         if ($dEntry['VISIBLE']) {
             if ($dEntry['URL']) {
                 $oURL = new WYURL($dEntry['URL']);
                 $bOpenInNewWindow = $webyep_bOpenFullURLsInNewWindow && WYURL::bIsAbsolute($dEntry['URL']);
                 $bUseTitleAsItem = true;
             } else {
                 $oURL = od_clone($this->oURL);
             }
             // new feature: suppress DI, if user specifies somepage.php?DOC_INST=0 in URL field
             if (!isset($oURL->dQuery[WY_QK_DI]) || $oURL->dQuery[WY_QK_DI] > 0) {
                 $oURL->dQuery[WY_QK_DI] = $dEntry[WY_DK_ITEMID];
                 // overwrite existing DI, otherwise we could not delete those contents!
                 if ($webyep_bTitleAlwaysOpensPage) {
                     $bUseTitleAsItem = true;
                 }
             } else {
                 unset($oURL->dQuery[WY_QK_DI]);
                 // really dispose
             }
             $sURL = $oURL->sEURL(true, true, $dEntry['URL'] != "");
             // is this entry expanded?
             if (!$webyep_bUseJavaScriptMenus || in_array($dEntry[WY_DK_ITEMID], $this->aCurrentPath) || in_array($sElementID, $this->aOpenTrees)) {
                 $bIsExpanded = true;
             }
             // CSS
             $bIsCurrentEntry = $this->_bIsCurrentEntry($dEntry[WY_DK_ITEMID], $dEntry['URL']);
             if (!$bIsCurrentEntry && in_array($dEntry[WY_DK_ITEMID], $this->aCurrentPath)) {
                 $aClass[] = WEBYEP_MENU_CSS_CURRENT_PATH;
             }
             if ($bIsCurrentEntry) {
                 $aClass[] = WEBYEP_MENU_CSS_CURRENT_ITEM;
             }
             if ($iEntryNr == 1) {
                 $aClass[] = WEBYEP_MENU_CSS_FIRST_ITEM;
             }
             if ($bIsTitle) {
                 unset($aClass[0]);
                 // no WEBYEP_MENU_CSS_ITEM for titles
                 $aClass[] = WEBYEP_MENU_CSS_TITLE;
                 $aClass[] = WEBYEP_MENU_CSS_EXPANDED;
             }
             $sClass = implode(' ', $aClass);
             // assemble HTML
             $sText = str_replace("\\", "<br />", webyep_sHTMLEntities($dEntry['TITLE']));
             $sID = $bIsTitle ? ' id="WYMUTITLE' . $webyep_iMenuID . $dEntry[WY_DK_ITEMID] . '"' : '';
             $sHTML .= '<li class="' . $sClass . '"' . $sID . '>';
             $sHTML .= $this->buildLink($bIsTitle, $bUseTitleAsItem, $bIsExpanded, $sClass, $dEntry[WY_DK_ITEMID], $sText, $sURL);
             if ($bIsTitle) {
                 $this->iLastTitleID = $dEntry[WY_DK_ITEMID];
                 $sHTML .= $this->buildHtmlTree($dEntry['SUBITEMS']);
             }
             $sHTML .= "</li>\n";
         }
     }
     $sHTML .= '</' . $this->sListType . ">\n";
     return $sHTML;
 }
예제 #22
-1
파일: mp3-player.php 프로젝트: bcneb/WebYep
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr><td align="center" valign="middle">
<?php 
if ($goApp->bIsMac) {
    $sURL = $oURL->sEURL();
    $iWidth = 200;
    $iHeight = 16;
    echo "<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" width=\"{$iWidth}\" height=\"{$iHeight}\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">\n";
    echo "   <param name=\"SRC\" value=\"{$sURL}\">\n";
    echo "   <param name=\"AUTOPLAY\" value=\"true\">\n";
    echo "   <param name=\"CONTROLLER\" value=\"true\">\n";
    echo "   <embed src=\"{$sURL}\" width=\"{$iWidth}\" height=\"{$iHeight}\" autoplay=\"true\" controller=\"true\" pluginspage=\"http://www.apple.com/quicktime/download/\"></embed>\n";
    echo "</object>";
} else {
    $oWaxURL = od_clone($goApp->oProgramURL);
    $oWaxURL->addComponent("wax.php");
    $oWaxURL->dQuery["URL"] = $oURL->sURL();
    $oWaxURL->dQuery["IE"] = ".wax";
    $sURL = $oWaxURL->sEURL();
    $iWidth = 300;
    $iHeight = 72;
    // http://www.mioplanet.com/rsc/embed_mediaplayer.htm
    echo "<object classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" width=\"{$iWidth}\" height=\"{$iHeight}\" type=\"application/x-oleobject\">\n";
    echo "   <param name=\"filename\" value=\"{$sURL}\">\n";
    echo "   <param name=\"URL\" value=\"{$sURL}\">\n";
    echo "   <param name=\"uiMode\" value=\"mini\">\n";
    echo "   <param name=\"autostart\" value=\"true\">\n";
    echo "   <param name=\"showcontrols\" value=\"true\">\n";
    echo "   <param name=\"showstatusbar\" value=\"true\">\n";
    echo "   <param name=\"showdisplay\" value=\"false\">\n";
예제 #23
-1
 $sURL = $dEntry[URL];
 $sPath = $dEntry[PATH];
 $oImg = new WYImage(new WYURL($sURL));
 $iWidth = $oImg->iWidth();
 $iHeight = $oImg->iHeight();
 if ($iWidth != 0 && $iHeight != 0) {
     WYImage::bLimitSize($iWidth, $iHeight, IMG_SIZE, IMG_SIZE);
 } else {
     $iWidth = $iHeight = IMG_SIZE;
 }
 $oImg->setAttribute("width", $iWidth);
 $oImg->setAttribute("height", $iHeight);
 $oImg->setAttribute("style", "border: 0");
 unset($oTrashLink);
 unset($oTrashLinkURL);
 $oTrashLinkURL = od_clone(WYURL::oCurrentURL());
 $oTrashLinkURL->dQuery[ACTION] = ACTION_DELETE;
 $oTrashLinkURL->dQuery[FILENAME] = $sFilename;
 $oTrashLink = new WYLink($oTrashLinkURL);
 $oTrashLink->setAttribute("onclick", "return confirmDelete()");
 $oTrashLink->setInnerHTML($oTrashImg->sDisplay());
 $oTrashLink->setToolTip(WYTS("DeleteImageButton"));
 unset($oSelectLink);
 $oSelectLink = new WYLink(new WYURL("javascript:void(0)"));
 $oSelectLink->setAttribute("onclick", "returnURL(\"" . $sURL . "\"); return false;");
 $oSelectLink->setInnerHTML($oImg->sDisplay());
 $oSelectLink->setToolTip($sDisplayFilename);
 echo "<td>";
 echo $oSelectLink->sDisplay();
 echo "<div style=\"margin-bottom: 16px; margin-top: 6px; text-align: center\">";
 echo $oTrashLink->sDisplay();
예제 #24
-1
?>
'
        });

		CKEDITOR.on('instanceReady', function(evt) {
				var editor = evt.editor;
				editor.execCommand('maximize');
				wy_restoreSize();
			});

<?php 
$oStylesCodePath = od_clone($goApp->oProgramPath);
$oStylesCodePath->addComponent("opt");
$oStylesCodePath->addComponent("ckeditor_styles.js");
if ($oStylesCodePath->bExists()) {
    $oStylesCodeURL = od_clone($goApp->oProgramURL);
    $oStylesCodeURL->addComponent("opt");
    $oStylesCodeURL->addComponent("ckeditor_styles.js");
    ?>
			CKEDITOR.config.stylesCombo_stylesSet = 'WebYepStyles:"<?php 
    echo $oStylesCodeURL->sPath;
    ?>
"';

<?php 
}
?>
	}
</script>
<script type="text/javascript" src="<?php 
echo $oCKJSURL->sURL(false, false, true);
예제 #25
-1
 function oSpacerImg($iW, $iH)
 {
     $oImgURL = od_clone($this->oImageURL);
     $oImgURL->addComponent("nix.gif");
     $oImg = new WYImage($oImgURL);
     $oImg->setAttribute("width", $iW);
     $oImg->setAttribute("height", $iH);
     return $oImg;
 }