Example #1
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        RegisterResources();
        try
        {
            Response.CacheControl = "no-cache";
            Response.AddHeader("Pragma", "no-cache");
            Response.Expires = -1;

            string QueryLibType = "";
            jsLink1.Text = Request.ServerVariables["PATH_INFO"] + "?" + Ektron.Cms.API.JS.Escape(Request.ServerVariables["QUERY_STRING"].Replace("LangType", "L").Replace("SelectAll=1&", "")) + "&LangType=";

            m_refMsg = m_refContentApi.EkMsgRef;
            AppImgPath = m_refContentApi.AppImgPath;
            AppPath = m_refContentApi.AppPath;
            SitePath = m_refContentApi.SitePath;
            m_refLib = m_refContentApi.EkLibraryRef;
            UseLinkItPage = m_refContentApi.RequestInformationRef.LinkManagement;
            sDeleteLibItem.Text = m_refMsg.GetMessage("js: confirm delete lib item");

            Utilities.ValidateUserLogin();
            if (m_refContentApi.RequestInformationRef.UserId == 0)
            {
                Response.Redirect(m_refContentApi.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(m_refMsg.GetMessage("msg login cms user")), false);
                return;
            }
            if (Request.QueryString["enhancedmetaselect"] != null)
            {
                m_strEnhancedMetaSelect = Request.QueryString["enhancedmetaselect"];
            }
            if (Request.QueryString["metadataformtagid"] != null)
            {
                m_strMetadataFormTagId = Request.QueryString["metadataformtagid"];
            }

            if (!String.IsNullOrEmpty(Request.QueryString["autonavfolder"]))
            {
                autoNavFolder = long.Parse(Request.QueryString["autonavfolder"].ToString());
                IsRootFolder = System.Convert.ToBoolean(autoNavFolder == 0 ? true : false);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["caller"]))
            {
                caller = "&caller=" + Request.QueryString["caller"];
            }
            if (Request.QueryString["LangType"] != null)
            {
                if (Request.QueryString["LangType"] != "")
                {
                    m_intContentLanguage = System.Convert.ToInt32(Request.QueryString["LangType"]);
                }
                else if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                        m_intContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
            else if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
            {
                    m_intContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
            }

            if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                m_refContentApi.ContentLanguage = m_intContentLanguage;
            }
            contLangID = m_refContentApi.ContentLanguage.ToString();
            if (Request.Browser.Platform.IndexOf("Win") == -1)
            {
                IsMac = true;
            }
            if (!String.IsNullOrEmpty(Request.QueryString["selected"]))
            {
                sLinkText = Request.QueryString["selected"];
            }
            if (Request.QueryString["SelectAll"] != null)
            {
                blnSelectAll = true;
            }
            StyleSheetJS.Text = m_refStyle.GetClientScript();
            if (Request.QueryString["scope"] == "images")
            {
                LibType = "images";
                Session["LibCategory"] = LibType;
            }
            else
            {
                if (Request.QueryString["type"] != null)
                {
                    LibType = Request.QueryString["type"].ToString();
                    Session["LibCategory"] = LibType;
                }
                else
                {
                    LibType =  Session["LibCategory"].ToString();
                }

                if (LibType == "")
                {
                    LibType = "images";
                    Session["LibCategory"] = LibType;
                }
            }

            if ((!(LibType == "quicklinks" || LibType == "forms" || LibType == "hyperlinks")) && blnSelectAll == true)
            {
                m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }

            if (!String.IsNullOrEmpty(Request.QueryString["action"]))
            {
                    action = Request.QueryString["action"].ToLower();
            }

            foreach (string item in Request.QueryString.AllKeys)
            {
                if (m_QueryString == "")
                {
                    m_QueryString = item + "=" + Request.QueryString[item];
                }
                else
                {
                    m_QueryString += (string)("&" + item + "=" + Request.QueryString[item]);
                }
            }
            if (Request.QueryString["showthumb"] != null)
            {
                if (Request.QueryString["showthumb"] == "false")
                {
                    showThumbnail = false;
                }
            }
            m_QueryString = m_QueryString.Replace("SelectAll=1&", "");
            sEditor = Request.QueryString["EditorName"];

            if (!String.IsNullOrEmpty(Request.QueryString["id"]))
            {
                folder = long.Parse(Request.QueryString["id"].ToString());
            }
            else if (!String.IsNullOrEmpty(Request.QueryString["folder"]))
            {
                folder = long.Parse(Request.QueryString["folder"].ToString());
            }
            if (!String.IsNullOrEmpty(Request.QueryString["autonavfolder"]))
            {
                autoNavFolder = long.Parse(Request.QueryString["autonavfolder"].ToString());
                Session["AutoNavFolder" + "_" + folder] = autoNavFolder;
            }
            else
            {
                Session["AutoNavFolder" + "_" + folder] = folder;
            }

            if (!String.IsNullOrEmpty(Request.QueryString["dentrylink"]))
            {
                DEntryLink = int.Parse(Request.QueryString["dentrylink"].ToString());
            }

            if (action == "viewlibrarycategory" && !Page.IsPostBack)
            {
                Display_ViewLibraryCategory();
            }
            else if (action == "viewlibrarybycategory" && !Page.IsPostBack)
            {
                Display_ViewLibraryByCategory();
            }
            else if (action == "viewlibrarybycategory" && (Request.Form["aliassubmit"] != null) && Request.Form["aliassubmit"].ToLower() == "ok")
            {
                Display_ViewLibraryByCategory();
            }
            else if (action == "deleteitem")
            {
                Process_DeleteItem();
            }
            else if (action == "addlibraryitem")
            {
                if (Request.QueryString["type"] == null)
                {
                    QueryLibType = (string)("&type=" + LibType);
                }
                Response.Redirect((string)("mediauploader.aspx?" + m_QueryString + QueryLibType), false);
            }

            //Adding the MediaUploaderCommon User Control
            MediaUploaderCommon m_Muc;
            m_Muc = (MediaUploaderCommon)(LoadControl("controls/library/MediaUploaderCommon.ascx"));
            m_Muc.ID = "MediaUploaderCommon";
            DataHolder.Controls.Add(m_Muc);

        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }
Example #2
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        m_refMsg = m_refContentApi.EkMsgRef;
            if (m_refContentApi.RequestInformationRef.IsMembershipUser == 1 || m_refContentApi.RequestInformationRef.UserId == 0)
            {
                Response.Redirect(m_refContentApi.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(m_refMsg.GetMessage("msg login cms user")), false);
                return;
            }
            AppImgPath = m_refContentApi.AppImgPath;
            SitePath = m_refContentApi.SitePath;
            m_refLib = m_refContentApi.EkLibraryRef;
            StyleSheetJS.Text = m_refStyle.GetClientScript();
            UseLinkItPage = m_refContentApi.RequestInformationRef.LinkManagement;
            RegisterResources();
            action = "viewlibrarybycategory";
            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    m_intContentLanguage = System.Convert.ToInt32(Request.QueryString["LangType"]);
                }
                else
                {
                    if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        m_intContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    m_intContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }

            if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                m_refContentApi.ContentLanguage = m_intContentLanguage;
            }

            if (Request.QueryString["scope"] == "images")
            {
                LibType = "images";
                Session["LibCategory"] = LibType;
            }
            else if (Request.QueryString["type"] == null && Request.QueryString["scope"] == "images,hLink,files")
            {
                LibType = "images";
                Session["LibCategory"] = LibType;
            }
            else
            {
                if (!String.IsNullOrEmpty(Request.QueryString["type"]))
                {
                    LibType = Request.QueryString["type"];
                    Session["LibCategory"] = LibType;
                }
                else
                {
                    LibType = Session["LibCategory"].ToString();
                }

                if (LibType == "")
                {
                    LibType = "images";
                    Session["LibCategory"] = LibType;
                }
            }
            if (Request.Browser.Platform.IndexOf("Win") == -1)
            {
                IsMac = true;
            }
            if (!(LibType == "quicklinks" || LibType == "forms" || LibType == "hyperlinks" || LibType == "files" || LibType == "images"))
            {
                m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }

            if (!String.IsNullOrEmpty(Request.QueryString["action"]))
            {
                    action = Request.QueryString["action"].ToLower();
            }
            if (!String.IsNullOrEmpty(Request.QueryString["id"]))
            {
                folder = Convert.ToInt64(Request.QueryString["id"]);
            }
            else if (!String.IsNullOrEmpty(Request.QueryString["folder"]))
            {
                folder = Convert.ToInt64(Request.QueryString["folder"]);
            }
            RetField = Request.QueryString["RetField"];
            if (!String.IsNullOrEmpty(RetField))
            {
                RetField = (string)("&RetField=" + EkFunctions.HtmlEncode(RetField).Replace("&", "&"));

            }

            Item_scope = Request.QueryString["Scope"];
            if (!String.IsNullOrEmpty(Item_scope))
            {
                Item_scope = (string)("&Scope=" + Item_scope);

                if (Item_scope.Trim() != "")
                {
                    RetField = Item_scope + RetField;
                }
            }
            if (!String.IsNullOrEmpty(Request.QueryString["disableLinkManage"]))
            {
                UseLinkItPage = false;
            }
            if (action.ToLower() == "viewlibrarybycategory" && ! IsPostBack)
            {
                Display_ViewLibraryByCategory();
            }
    }