示例#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;
}