コード例 #1
0
    protected virtual void BindBottomBar()
    {
        if (Page.User.IsInRole("Admin"))
        {
            if (!String.IsNullOrEmpty(ComponentName) && !String.IsNullOrEmpty(ComponentAdminPage))
            {
                m_ComponentAdminLink.Text        = "<span>" + ComponentName + " Manager</span>";
                m_ComponentAdminLink.NavigateUrl = "~/admin/" + ComponentAdminPage;
                m_ComponentAdminLink.CssClass   += (String.IsNullOrEmpty(m_ComponentAdminLink.CssClass) ? "" : " ") + ComponentName.ToLower().Replace(" ", "") + "Icon";
            }
            else
            {
                m_ComponentAdminLink.Visible = false;
            }

            if (!String.IsNullOrEmpty(ComponentAdditionalLink))
            {
                m_EditPagePropertiesLink.NavigateUrl = ComponentAdditionalLink;
            }
            else
            {
                m_EditPagePropertiesLink.Visible = false;
            }

            if (m_CMSPlaceHolder != null)
            {
                Dictionary <string, string> regionNames = Classes.ContentManager.CMSHelpers.HasFullCMSPermission() ? GetRegionNames(this, new Dictionary <string, string>()) : new Dictionary <string, string>();
                m_PageRegionsRepeater.DataSource = regionNames;
                m_PageRegionsRepeater.DataBind();
                if (regionNames.Count == 0)
                {
                    m_CMSPlaceHolder.Visible = false;
                }
            }
        }
        else
        {
            m_ClearSiteCacheLink.Visible = m_EditPagePropertiesLink.Visible = m_ComponentAdminLink.Visible = m_CMSPlaceHolder.Visible = false;
        }
        HideBottomBar  = Request.Cookies[m_BottomBarToggleCookieName] != null && !Convert.ToBoolean(Request.Cookies[m_BottomBarToggleCookieName].Value);
        UnpinBottomBar = Request.Cookies[m_BottomBarPinCookieName] != null && !Convert.ToBoolean(Request.Cookies[m_BottomBarPinCookieName].Value);
    }