예제 #1
0
// WebYep
// (C) Objective Development Software GmbH
// http://www.obdev.at
define("ACTION", "ACTION");
define("ACTION_UPLOAD", "UPLOAD");
$webyep_bDocumentPage = false;
$webyep_sIncludePath = "..";
include_once "{$webyep_sIncludePath}/webyep.php";
if (!$goApp->bEditMode) {
    $goApp->log("Editor " . basename($_SERVER['PHP_SELF']) . " called in non edit mode");
    exit;
}
include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYHiddenField.php";
include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYFileUpload.php";
$oHFFunctioNumber = new WYHiddenField('CKEditorFuncNum');
$iFunctionNumber = (int) $oHFFunctioNumber->sValue();
$oFU = new WYFileUpload("upload");
$bOK = false;
$sResponse = "";
$sURL = "";
if (isset($_REQUEST['CKEditor'])) {
    if ($oFU->bUploadOK()) {
        $oOriginalName = od_clone($oFU->oOriginalFilename());
        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}";
예제 #2
0
파일: gallery.php 프로젝트: bcneb/WebYep
include_once @webyep_sConfigValue('webyep_sIncludePath') . '/lib/WYEditor.php';
$bOK = false;
$sHelpFile = 'gallery-element.php';
$oEditor = new WYEditor();
$oHFImageID = new WYHiddenField(WY_QK_GALLERY_IMAGE_ID);
$iImageID = (int) $oHFImageID->sValue();
$oHFTNWidth = new WYHiddenField(WY_QK_THUMB_WIDTH);
$iTNWidth = (int) $oHFTNWidth->sValue();
$oHFTNHeight = new WYHiddenField(WY_QK_THUMB_HEIGHT);
$iTNHeight = (int) $oHFTNHeight->sValue();
$oHFImageWidth = new WYHiddenField(WY_QK_IMAGE_WIDTH);
$iImageWidth = (int) $oHFImageWidth->sValue();
$oHFImageHeight = new WYHiddenField(WY_QK_IMAGE_HEIGHT);
$iImageHeight = (int) $oHFImageHeight->sValue();
$oElement = new WYGalleryElement($oEditor->sFieldName, $oEditor->bGlobal, $iTNWidth, $iTNHeight, 0, $iImageWidth, $iImageHeight);
$oHFNewImage = new WYHiddenField(WY_QK_GALLERY_ADD, 'false');
$bNewImage = $oHFNewImage->sValue() == 'true';
$oTA = new WYTextArea('TEXT', $bNewImage ? '' : $oElement->sTextForID($iImageID));
$oTA->setWidth(30);
$oTA->setHeight(7);
$oFU = new WYFileUpload('IMAGE_FILE', $bNewImage);
$oFP = od_nil;
$sResponse = '';
$iNrOfErrors = 0;
if ($oEditor->bSave) {
    // if about to save, ...
    if ($bNewImage) {
        // ...and there is at least one new image, ...
        for ($j = 0; $j < $oFU->iNrOfFiles; $j++) {
            // ...save ALL files, ...
            $bHasError = false;
예제 #3
0
파일: logon.php 프로젝트: bcneb/WebYep
// WebYep
// (C) Objective Development Software GmbH
// http://www.obdev.at
$webyep_bDocumentPage = false;
$webyep_sIncludePath = ".";
include_once "{$webyep_sIncludePath}/webyep.php";
include_once "lib/WYApplication.php";
include_once "lib/WYTextField.php";
include_once "lib/WYHiddenField.php";
include_once "lib/WYEditor.php";
define("WY_QV_LOGON", "LOGON");
$bSuccess = false;
$oPageURL = od_nil;
$bDoLogon = $goApp->sFormFieldValue(WY_QK_ACTION) == WY_QV_LOGON;
$oHFPageURL = new WYHiddenField(WY_QK_LOGON_PAGE_URL);
if ($oHFPageURL->sValue()) {
    $oPageURL = new WYURL($oHFPageURL->sValue());
    $oPageURL->dQuery[WY_QK_EDITMODE] = "yes" . mt_rand(1000, 9999);
    unset($oPageURL->dQuery[WY_QK_LOGOUT]);
}
$oTFUsername = new WYTextField("USERNAME");
$oTFPassword = new WYTextField("PASSWORD");
$oTFPassword->makePasswordField();
if ($bDoLogon) {
    $bSuccess = $goApp->bAuthenticate($oTFUsername->sValue(), $oTFPassword->sValue());
    webyep_checkDataFolderIntegrity();
    if (webyep_bHasFilemanager()) {
        session_start();
        $_SESSION[WY_SV_IS_AUTH] = $bSuccess;
    }
예제 #4
0
파일: audio.php 프로젝트: bcneb/WebYep
<?php

// WebYep
// (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/WYAudioElement.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";
$sHelpFile = "audio-element.html";
$oEditor = new WYEditor();
$oHFDelete = new WYHiddenField("DELETE_FILE");
$oFU = new WYFileUpload("AUDIO_FILE");
$oElement = new WYAudioElement($oEditor->sFieldName, "");
$oFP = od_nil;
$sMaxUpload = ini_get("upload_max_filesize");
$sMaxUpload = str_replace("M", "MB", $sMaxUpload);
$bOK = 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();
예제 #5
0
$oHFFunctioNumber = new WYHiddenField('CKEditorFuncNum');
$sFunctionNumber = $oHFFunctioNumber->sValue();
$oHFLanguageCode = new WYHiddenField('langCode');
$sLangCode = $oHFLanguageCode->sValue();
$oHFAction = new WYHiddenField(ACTION);
$sAction = $oHFAction->sValue();
//	$sResponse = WYTS("RichTextSaved");
//   $oCKBaseURL = od_clone($goApp->oProgramURL);
//   $oCKBaseURL->addComponent("opt");
//   $oCKBaseURL->addComponent("ckeditor");
//	$oCKJSURL = od_clone($oCKBaseURL);
//	$oCKJSURL->addComponent("ckeditor.js");
$goApp->outputWarningPanels();
// give App a chance to say something
if ($sAction == ACTION_DELETE) {
    $oHFFilename = new WYHiddenField(FILENAME);
    $oFullPath = od_clone($goApp->oDataPath);
    $oFilename = new WYPath($oHFFilename->sValue());
    if ($oFilename->bCheck(WYPATH_CHECK_JUSTIMAGE | WYPATH_CHECK_NOPATH)) {
        $oFullPath->addComponent($oFilename->sPath);
        $oFile = new WYFile($oFullPath);
        $oFile->bDelete();
    }
}
$aEntries = array();
$r = opendir($goApp->oDataPath->sPath);
while (($sEntry = readdir($r)) !== false) {
    if ($sEntry[0] == ".") {
        continue;
    }
    if (substr($sEntry, 0, 5) != "rtimg") {
예제 #6
0
파일: menu.php 프로젝트: bcneb/WebYep
$sResponse = WYTS("MenuSaved");
$sHelpFile = "menu-element.php";
$oEditor = new WYEditor();
//$sMenuName = "MENU";
//$sTextFieldName = "ITEM";
//$aTitles = array();
//$aIDs = array();
//$dItems = array();
//$i = 0;
//$iC = 0;
//$oSM = od_nil;
//$oTFItem = od_nil;
//$oHFTitles = new WYHiddenField("MENU_TITLES");
//$oHFIDs = new WYHiddenField("MENU_IDS");
$oTAWYEditorPostArea = new WYTextArea('WY_EditorPostArea');
$oHFURL = new WYHiddenField(WY_QK_MENU_URL);
$sURL = $oHFURL->sValue();
if ($sURL) {
    $oURL = new WYURL($sURL);
    //echo '$oURL = '.$oURL->sEURL().', $sURL = '.$sURL;
} else {
    $oURL = od_nil;
    //echo '$oURL = od_nil';
}
$oElement = new WYMenuElement($oEditor->sFieldName, $oEditor->bGlobal, $oURL, "", "", od_nil);
if ($oEditor->bSave) {
    if (isset($oTAWYEditorPostArea->sText)) {
        $chunks = explode('|@|', $oTAWYEditorPostArea->sText());
        $chunks[1] = explode('|§|', $chunks[1]);
        $oElement->dContent = parseDataForServer($chunks[1], $chunks[2]);
        $oElement->save();
예제 #7
0
파일: image.php 프로젝트: bcneb/WebYep
$webyep_sIncludePath = "..";
include_once "{$webyep_sIncludePath}/webyep.php";
include_once @webyep_sConfigValue("webyep_sIncludePath") . "/elements/WYImageElement.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";
$bOK = false;
$sHelpFile = "image-element.php";
$oEditor = new WYEditor();
$oHFDelete = new WYHiddenField("DELETE_IMAGE");
$oHFImageWidth = new WYHiddenField(WY_QK_IMAGE_WIDTH);
$oHFImageHeight = new WYHiddenField(WY_QK_IMAGE_HEIGHT);
$oHFIsThumb = new WYHiddenField(WY_QK_IS_THUMB);
$oHFThumbWidth = new WYHiddenField(WY_QK_THUMB_WIDTH);
$oHFThumbHeight = new WYHiddenField(WY_QK_THUMB_HEIGHT);
$oFU = new WYFileUpload("IMAGE_FILE");
$oTFURL = new WYTextField("LINK_URL");
$oTFURL->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 {