Beispiel #1
0
 private void Page_Load(System.Object sender, System.EventArgs e)
 {
     CommonApi m_refAPI = new CommonApi();
         try
         {
             if (m_refAPI.GetCookieValue("site_preview") == "1")
             {
                 m_refAPI.SetCookieValue("site_preview", "0");
             }
             else
             {
                 m_refAPI.SetCookieValue("site_preview", "1");
             }
         }
         catch (Exception)
         {
         }
         finally
         {
             m_refAPI = null;
         }
 }
Beispiel #2
0
 public static void SetLanguage(CommonApi api)
 {
     int ContentLanguage = -1;
     if (!(System.Web.HttpContext.Current.Request.QueryString["LangType"] == null))
     {
         if (System.Web.HttpContext.Current.Request.QueryString["LangType"] != "")
         {
             ContentLanguage = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["LangType"]);
             api.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
         }
         else
         {
             if (api.GetCookieValue("LastValidLanguageID") != "")
             {
                 ContentLanguage = Convert.ToInt32(api.GetCookieValue("LastValidLanguageID"));
             }
         }
     }
     else
     {
         if (api.GetCookieValue("LastValidLanguageID") != "")
         {
             ContentLanguage = Convert.ToInt32(api.GetCookieValue("LastValidLanguageID"));
         }
     }
     if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
     {
         api.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
     }
     else
     {
         api.ContentLanguage = ContentLanguage;
     }
 }
Beispiel #3
0
 public StyleHelper()
 {
     m_refAPI = new CommonApi();
     string strLangID;
     strLangID = System.Web.HttpContext.Current.Request.QueryString["LangType"];
     if (strLangID != null && Information.IsNumeric(strLangID))
     {
         try
         {
             ContentLanguage = Convert.ToInt32(strLangID);
         }
         catch (Exception ex)
         {
             EkException.LogException(ex, System.Diagnostics.EventLogEntryType.Warning);
             EkException.WriteToEventLog((string)("Language string was: " + strLangID), System.Diagnostics.EventLogEntryType.Warning);
         }
         m_refAPI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
     }
     else
     {
         strLangID = m_refAPI.GetCookieValue("LastValidLanguageID");
         if (strLangID != null && Information.IsNumeric(strLangID))
         {
             ContentLanguage = Convert.ToInt32(strLangID);
         }
     }
     if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
     {
         m_refAPI.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
     }
     else
     {
         m_refAPI.ContentLanguage = ContentLanguage;
     }
     DisplayTransText = m_refAPI.DisplayTransText;
     m_refMsg = m_refAPI.EkMsgRef;
 }
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);
        Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronJQueryUiDefaultCss);
        FeaturesTodo_CB.Visible = false;

        CommonApi refCommonAPI = new CommonApi();
        if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.SocialNetworking))
        {
            Utilities.ShowError(m_refContentApi.EkMsgRef.GetMessage("feature locked error"));
        }
        m_userId = refCommonAPI.RequestInformationRef.UserId;
        AppPath = m_refContentApi.AppPath;
        lblUpload.Text = m_refMsg.GetMessage("upload txt");
        mailServer = GetNotificationEmailServer();
        lblProperties.Text = m_refMsg.GetMessage("generic properties");
        lblTags.Text = m_refMsg.GetMessage("lbl personal tags");
        lblCategory.Text = m_refMsg.GetMessage("lbl category");
        try
        {
            if (!this.IsCallback)
            {
                RegisterResources();

                //cgae_userselect_done_btn.Attributes.Add("onclick", "GetCommunityMsgObject(\'" + m_uniqueId + "\').MsgSaveMessageTargetUI(); return false;");
                cgae_userselect_done_btn.Attributes.Add("onclick", "AddAdminUsers();return false;");
                cgae_userselect_done_btn.Attributes.Add("class", "EktMsgTargetsDoneBtn");
                cgae_userselect_done_btn.Text = m_refMsg.GetMessage("btn done");
                //cgae_userselect_done_btn.Tooltip = m_refMsg.GetMessage("btn done")

                cgae_userselect_cancel_btn.Attributes.Add("onclick", "GetCommunityMsgObject(\'" + m_uniqueId + "\').MsgCancelMessageTargetUI(); return false;");
                cgae_userselect_cancel_btn.Attributes.Add("class", "EktMsgTargetsCancelBtn");
                cgae_userselect_cancel_btn.Text = m_refMsg.GetMessage("btn cancel");
                //cgae_userselect_cancel_btn.Tooltip = m_refMsg.GetMessage("btn cancel")

                Invite_UsrSel.SingleSelection = true;

                CheckAccess();
                if (!bAccess)
                {
                    throw (new Exception(this.m_iID > 0 ? (this.GetMessage("err communityaddedit no access")) : (this.GetMessage("err no perm add cgroup"))));
                }
                this.GroupAvatar_TB.Attributes.Add("onkeypress", "updateavatar();");
                if (!string.IsNullOrEmpty(Request.QueryString["thickbox"]))
                {
                    bThickBox = true;
                    Ektron.Cms.API.Css.RegisterCss(this, this.AppPath + "csslib/ektron.communitygroup.addedit.tb.ui.css", "EktronCommunityGroupAddEditTbUiCSS");
                }
                int langID = m_refContentApi.DefaultContentLanguage;
                if (Request.QueryString["LangType"] == null && Request.QueryString["LangType"] == "")
                {
                    langID = m_refContentApi.ContentLanguage;
                }
                else
                {
                    langID = Convert.ToInt32(Request.QueryString["LangType"]);
                }
                if (langID == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || langID == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                {
                    langID = int.Parse(refCommonAPI.GetCookieValue("SiteLanguage"));
                }

                m_refContentApi.SetCookieValue("LastValidLanguageID", langID.ToString());
                if (Request.QueryString["thickbox"] != "" && (Request.QueryString["tid"] != null))
                {
                    long.TryParse((string)(Request.QueryString["tid"].ToString()), out TaxonomyId);
                    TaxonomyLanguage = langID;
                }
                if (Request.QueryString["profileTaxonomyId"] != "" && Information.IsNumeric(Request.QueryString["profileTaxonomyId"]) && Convert.ToInt64(Request.QueryString["profileTaxonomyId"]) > 0)
                {
                    profileTaxonomyId = Convert.ToInt64(Request.QueryString["profileTaxonomyId"]);
                }
                if (Page.IsPostBack)
                {
                    if (!Page.IsCallback)
                    {
                        Process_EditGroup();
                    }
                }
                else
                {
                    //Invite_UsrSel.Initialize()
                    switch (this.m_sPageAction)
                    {
                        case "delete":
                            Process_DeleteGroup();
                            break;
                        default:
                            EmitJavascript();
                            RenderRecipientSelect();
                            EditGroup();
                            SetTaxonomy(this.m_iID);
                            SetAlias(this.m_iID);
                            break;
                    }
                }
                SetLabels();
            }
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }