Пример #1
0
function webyep_menu($sFieldName, $bGlobal, $sURL, $sTarget = "", $sDeprecatedA = "", $sBulletImg = "")
{
    // $sDeprecatedA: was $sSelectedItemStyle, now non configurable WEBYEP_MENU_CSS_SELECTED
    // $sBulletImg: deprecated as of 1.7.0
    global $goApp;
    $oURL = od_nil;
    $oBulletImg = od_nil;
    $oURL = new WYURL($sURL);
    //if ($sBulletImg) $oBulletImg = new WYImage(new WYURL($sBulletImg));
    $o = new WYMenuElement($sFieldName, $bGlobal, $oURL, $sTarget, $oBulletImg);
    $sHTML = $o->sDisplay();
    // this should be removed in future versions
    if ($sDeprecatedA) {
        $s = str_replace(WEBYEP_MENU_CSS_SELECTED, $sDeprecatedA, $s);
    }
    if ($goApp->bEditMode) {
        if (!$sHTML) {
            $sHTML = "<div>" . $o->sName . "</div>";
        }
        $sHTML = $o->sEditButtonHTML("edit-button-menu.gif", "", od_nil) . $sHTML;
    }
    echo $sHTML;
}
Пример #2
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();
        $bOK = true;
    }
} else {
    $sContent = parseDataForClient($oElement->dContent, $oURL->sURL());
}
$goApp->outputWarningPanels();
// give App a chance to say something
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">