Exemple #1
0
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;
    }
}
if (!$bDoLogon) {
    $sOnLoadScript = 'document.forms[0].USERNAME.focus();';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- InstanceBegin template="/Templates/panels.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="HeadPHPCode" -->
<?php 
Exemple #2
0
$webyep_bDocumentPage = false;
$webyep_sIncludePath = "..";
include_once "{$webyep_sIncludePath}/webyep.php";
include_once @webyep_sConfigValue("webyep_sIncludePath") . "/elements/WYShortTextElement.php";
include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYTextField.php";
include_once @webyep_sConfigValue("webyep_sIncludePath") . "/lib/WYEditor.php";
$bOK = false;
$sResponse = WYTS("ShortTextSaved");
$sHelpFile = "shorttext-element.php";
$oEditor = new WYEditor();
$oTF = new WYTextField("TEXT");
$oTF->setWidth($goApp->bIsiPhone ? 40 : 40);
$oTF->setAttribute("id", "inputTextField");
$oElement = new WYShortTextElement($oEditor->sFieldName, $oEditor->bGlobal);
if ($oEditor->bSave) {
    $oElement->setText($oTF->sValue());
    $oElement->save();
    $bOK = true;
} else {
    $oTF->setValue($oElement->sText());
    $sOnLoadScript = 'document.forms[0].TEXT.focus();';
}
$goApp->outputWarningPanels();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>

<title>
<?php 
WYTSD("ShortTextEditorTitle", true);
?>
Exemple #3
0
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();
            }