Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.ContentType = "application/javascript";
        // initialize additional variables for later use
        m_refMsg = m_refSiteApi.EkMsgRef;

        // instantiate contentAPI reference
        ContentAPI contentApi = new ContentAPI();

        // assign the resource text values as needed
        jsAddPage.Text = m_refMsg.GetMessage("lbl pagebuilder add page");
        jsAppPath.Text = contentApi.AppPath;
        jsBack.Text = m_refMsg.GetMessage("back");
        jsCancel.Text = m_refMsg.GetMessage("btn cancel");
        jsFinish.Text = m_refMsg.GetMessage("btn finish");
        jsNext.Text = m_refMsg.GetMessage("btn next");
        jsOk.Text = m_refMsg.GetMessage("lbl ok");
        jsSavePageAs.Text = m_refMsg.GetMessage("lbl pagebuilder save page");
        jsWizardsPath.Text = (contentApi.AppPath + "pagebuilder/wizards/");
        jsErrorPageTitle.Text = m_refMsg.GetMessage("lbl pagebuilder error page title");
        jsErrorSelectLayout.Text = m_refMsg.GetMessage("lbl pagebuilder error select layout");
        jsErrorUrlAlias.Text = m_refMsg.GetMessage("lbl pagebuilder error url alias");
        jsErrorUrlAliasExists.Text = m_refMsg.GetMessage("lbl pagebuilder error url alias exists");
        jsdropdownMustMatch.Text = m_refMsg.GetMessage("lbl pagebuilder error url alias selection must match");
        jsinvalidExtension.Text = m_refMsg.GetMessage("lbl pagebuilder error url alias invalid extension");
        jsselectExtension.Text = m_refMsg.GetMessage("lbl pagebuilder error url alias select extension");
        jserrorMetadata.Text = m_refMsg.GetMessage("lbl pagebuilder error metadata");
        jserrorTaxonomy.Text = m_refMsg.GetMessage("lbl pagebuilder error taxonomy");
        jsloading.Text = m_refMsg.GetMessage("lbl sync loading");
        jsAddMaster.Text = m_refMsg.GetMessage("lbl Add Master Layout");
    }
Beispiel #2
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        StyleHelper objStyle;
            try
            {
                RegisterResources();
                Utilities.ValidateUserLogin();
                if ((m_refAPI.RequestInformationRef.IsMembershipUser > 0) || (m_refAPI.RequestInformationRef.UserId == 0))
                {
                    Response.Redirect("blank.htm", false);
                    return;
                }
                objStyle = new StyleHelper();
                StyleSheetJS.Text = objStyle.GetClientScript();
                jsAppImgPath.Text = m_refAPI.AppImgPath;
                HelpButton.Text = objStyle.GetHelpButton("navtoolbar_aspx", "");
                m_msgHelper = m_refAPI.EkMsgRef;

            }
            catch (Exception)
            {

            }
            finally
            {
                objStyle = null;
            }
    }
 protected string GetMessage(string key)
 {
     if (null == m_refMsg)
     {
         m_refMsg = GetCommonApi().EkMsgRef;
     }
     return m_refMsg.GetMessage(key);
 }
Beispiel #4
0
 public ClientPaging()
 {
     CurrentPageIndex = 0;
     SelectedPage = 0;
     TotalPages = 0;
     _ContentApi = new Ektron.Cms.ContentAPI();
     _MessageHelper = _ContentApi.EkMsgRef;
 }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_refMsg = m_refSiteApi.EkMsgRef;
        ContentAPI capi = new ContentAPI();

        // Register JS
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronTreeviewJS);
    }
Beispiel #6
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        StyleHelper objStyle = new StyleHelper();
            m_refmsg = (new Ektron.Cms.CommonApi()).EkMsgRef;

            HelpButton1.Text = objStyle.GetHelpButton("FormWizardStep1", "");
            HelpButton2.Text = objStyle.GetHelpButton("FormWizardStep2", "");
            HelpButton3.Text = objStyle.GetHelpButton("FormWizardStep3", "");
            HelpButton4.Text = objStyle.GetHelpButton("FormWizardStep4", "");
            HelpButton5.Text = objStyle.GetHelpButton("FormWizardStep5", "");
            objStyle = null;
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_refMsg = m_refSiteApi.EkMsgRef;
        ContentAPI capi = new ContentAPI();

        // Register JS
        if (capi.IsLoggedIn)
        {
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronTreeviewJS);

            ICmsContextService cmsContextService = ServiceFactory.CreateCmsContextService();
            Ektron.Cms.Framework.UI.Css.Register(this, cmsContextService.SitePath + "/widgets/ContentBlock/ektron.treeview.css");
        }
    }
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        SiteAPI m_refSiteApi = new SiteAPI();
            UserAPI m_refUserApi = new UserAPI();
            m_refMsg = m_refSiteApi.EkMsgRef;
            AppImgPath = m_refSiteApi.AppImgPath;
            AppName = m_refSiteApi.AppName;
            SITEPATH = m_refSiteApi.SitePath;

            //call api and display values

            td_asset_loc.InnerHtml = "assets";
            td_private_asset_loc.InnerHtml = "private";
            td_domain_username.InnerHtml = "user1";
    }
Beispiel #9
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        ContentAPI m_refContApi = new ContentAPI();
        string strAction = "";
        string showBackButton = "";
        m_refMsg = m_refContApi.EkMsgRef;
        AppName = m_refContApi.AppName;
        if (!(Request.QueryString["LangType"] == null))
        {
            if (Request.QueryString["LangType"] != "")
            {
                m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                m_refContApi.SetCookieValue("LastValidLanguageID", m_intContentLanguage.ToString());
            }
            else
            {
                if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
                }
            }
        }
        else
        {
            if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
            {
                m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
            }
        }

        if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
        {
            strAction = (string)("&action=" + Request.QueryString["action"]);
        }

        if (!(Request.QueryString["showbackbutton"] == null) && Request.QueryString["showbackbutton"] != "")
        {
            showBackButton = (string)("&showbackbutton=" + Request.QueryString["showBackButton"]);
        }

        //list_frame.Attributes("src") = "historylist.aspx?LangType=" & m_intContentLanguage & "&id=" & Request.QueryString("id") & strAction
        history_frame.Attributes["src"] = "history.aspx?LangType=" + m_intContentLanguage + "&id=" + Request.QueryString["id"] + strAction + showBackButton;
    }
Beispiel #10
0
 private void Page_Load(System.Object sender, System.EventArgs e)
 {
     StyleHelper objStyle;
         try
         {
             m_MsgHelper = m_refAPI.EkMsgRef;
             objStyle = new StyleHelper();
             StyleSheetJS = objStyle.GetClientScript();
             jsAppImgPath.Text = m_refAPI.AppImgPath;
             Utilities.ValidateUserLogin();
         }
         catch (Exception)
         {
         }
         finally
         {
             objStyle = null;
         }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.ContentType = "application/javascript";
        // initialize additional variables for later use
        m_refMsg = m_refSiteApi.EkMsgRef;

        // instantiate contentAPI reference
        ContentAPI contentApi = new ContentAPI();

        // assign the resource text values as needed
        jsCancel.Text = m_refMsg.GetMessage("generic cancel");
        jsDropControlHere.Text = m_refMsg.GetMessage("lbl pagebuilder drop control here");
        jsEm.Text = m_refMsg.GetMessage("generic em");
        jsNewWidth.Text = m_refMsg.GetMessage("lbl pagebuilder new width");
        jsPixels.Text = m_refMsg.GetMessage("generic pixels");
        jsPercent.Text = m_refMsg.GetMessage("generic percent");
        jsSave.Text = m_refMsg.GetMessage("generic save");
        jsWidget.Text = m_refMsg.GetMessage("generic widget");
    }
Beispiel #12
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        try
            {
                m_refContentApi = new ContentAPI();
                AppImgPath = m_refContentApi.AppImgPath;
                m_refMsg = m_refContentApi.EkMsgRef;
                Utilities.ValidateUserLogin();
                RegisterResources();
                if (!(Request.QueryString["folderid"] == null))
                {
                    if (!string.IsNullOrEmpty(Request.QueryString["folderid"]))
                    {
                        m_intFolderId = long.Parse(Request.QueryString["folderid"].ToString()) ;
                    }
                }
                if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
                {
                    ContentLanguage = int.Parse(Request.QueryString["LangType"].ToString()) ;
                    m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                }
                else
                {
                    if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
                m_refContentApi.ContentLanguage = ContentLanguage;

                StyleSheetJS = m_refStyle.GetClientScript();

                if (Page.IsPostBack == false)
                {
                    Display_ToolBar();
                }
            }
            catch (Exception ex)
            {
                Utilities.ShowError(ex.Message);
            }
    }
Beispiel #13
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refSiteApi.EkMsgRef;
        Utilities.ValidateUserLogin();
        if (m_refSiteApi.RequestInformationRef.IsMembershipUser == 1 || m_refSiteApi.RequestInformationRef.UserId == 0)
        {
            Response.Redirect(m_refSiteApi.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(m_refMsg.GetMessage("msg login cms user")), false);
            return;
        }
        // Register JS
        JS.RegisterJS(this, JS.ManagedScript.EktronJS);
        JS.RegisterJS(this, JS.ManagedScript.EktronXmlJS);
        JS.RegisterJS(this, JS.ManagedScript.EktronModalJS);
        JS.RegisterJS(this, m_refSiteApi.AppPath + "PageBuilder/Wizards/js/ektron.pagebuilder.wizards.js", "EktronPageBuilderWizardsJS");
        JS.RegisterJS(this, m_refSiteApi.AppPath + "PageBuilder/Wizards/js/wizardResources.aspx", "EktronPageBuilderWizardResourcesJS");

        // register necessary CSS
        Css.RegisterCss(this, Css.ManagedStyleSheet.EktronModalCss);
        Css.RegisterCss(this, m_refSiteApi.AppPath + "PageBuilder/Wizards/css/ektron.pagebuilder.wizards.css", "EktronPageBuilderWizardsCSS");
    }
Beispiel #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_refMsg = m_refSiteApi.EkMsgRef;
        ContentAPI capi = new ContentAPI();
        Ektron.Cms.API.Content.Taxonomy tax = new Ektron.Cms.API.Content.Taxonomy();
        TaxonomyRequest tr = new TaxonomyRequest();
        tr.IncludeItems = false;
        tr.Depth = 1;
        tr.Page = Page;
        tr.TaxonomyId = 0;
        tr.TaxonomyLanguage = capi.RequestInformationRef.ContentLanguage;
        tr.TaxonomyType = Ektron.Cms.Common.EkEnumeration.TaxonomyType.Content;
        tr.TaxonomyItemType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.Content;
        TaxonomyBaseData[] td = capi.EkContentRef.ReadAllSubCategories(tr);
        taxonomies.DataSource = td;
        taxonomies.DataBind();

        // Register JS
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronTreeviewJS);
    }
Beispiel #15
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        try
        {
            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                }
                else
                {
                    if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
            if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                m_refContentApi.ContentLanguage = ContentLanguage;
            }

            m_refMsg = m_refContentApi.EkMsgRef;
            StyleSheetJS.Text = m_refStyle.GetClientScript();
            if (Request.QueryString["action"] != null && Request.QueryString["action"] == "report")
            {
                ShowHistoryListFrame(false);
                ViewHistoryList m_viewHistoryList = new ViewHistoryList();
                m_viewHistoryList = (ViewHistoryList)(LoadControl("controls/history/ViewHistoryList.ascx"));
                m_viewHistoryList.ID = "ViewHistory";
                DataHolder.Controls.Add(m_viewHistoryList);
            }
            else
            {
                ShowHistoryListFrame(true);
                ViewHistory m_viewHistory = new ViewHistory();
                m_viewHistory = (ViewHistory)(LoadControl("controls/history/ViewHistory.ascx"));
                m_viewHistory.ID = "ViewHistory";
                DataHolder.Controls.Add(m_viewHistory);
            }
        }
        catch (Exception ex)
        {
            ShowError(ex.Message);
        }
    }
Beispiel #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_refMsg = m_contentApi.EkMsgRef;

        if (FolderID > -1)
        {
            if (folderData != null)
            {
                if (folderData.FolderTaxonomy.Length == 0)
                {
                    noTaxonomies.Text = m_refMsg.GetMessage("generic no taxonomy");
                    noTaxonomies.ToolTip = noTaxonomies.Text;
                }

                taxRequired.InnerText = folderData.CategoryRequired.ToString().ToLower();

                taxonomies.DataSource = folderData.FolderTaxonomy;
                taxonomies.DataBind();
            }
        }

        // Register JS
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronTreeviewJS);
        JS.RegisterJSInclude(this, m_contentApi.AppPath + "PageBuilder/taxonomytree.js", "TaxTreeJS");

        string inittree = String.Format("Ektron.TaxonomyTree.init(\"{0}\", \"{1}\");", m_contentApi.AppPath, txtselectedTaxonomyNodes.ClientID);
        try
        {
            JS.RegisterJSBlock(this, inittree, txtselectedTaxonomyNodes.ClientID + "TaxTreeInit");
        }
        catch
        {
            //we're apparently in a full postback which doesn't care for registerjsblock
            script.Text = "<script type=\"text/javascript\" defer=\"defer\"> window.setTimeout(function(){" + inittree + "}, 750); </script>";
            script.Visible = true;
        }

        // Register CSS
        Css.RegisterCss(this, Css.ManagedStyleSheet.EktronTreeviewCss);
    }
 private void Page_Load(System.Object sender, System.EventArgs e)
 {
     jsUniqueID.Text = "editvirtualstaging";
         m_refMsg = (new CommonApi()).EkMsgRef;
 }
Beispiel #18
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        Page.Response.ContentType = "text/xml";
        Page.Response.Clear();
        Page.Response.BufferOutput = true;

        string text = "";
        int pageNumber = 1;
        int totalPages = 0;
        int MaxResults = 0;
        int iLoop = 1;
        string strID = "";
        StringBuilder strFields = new StringBuilder();
        string strOnclick = "";
        long contentId = 0;
        long selectedId = -1;
        int languageID = m_commonApi.RequestInformationRef.ContentLanguage;
        m_refMsg = m_commonApi.EkMsgRef;

        Ektron.Cms.ContentAPI content_api = null;
        content_api = new Ektron.Cms.ContentAPI();
        if (content_api.GetCookieValue("LastValidLanguageID") != "" && Convert.ToInt32(content_api.GetCookieValue("LastValidLanguageID")) != -1)
        {
            languageID = Convert.ToInt32(content_api.GetCookieValue("LastValidLanguageID"));
        }

        text = Request.QueryString["text"];
        if (!string.IsNullOrEmpty(Request.QueryString["pnum"]) && Convert.ToInt32(Request.QueryString["pnum"]) > 0)
        {
            pageNumber = Convert.ToInt32(Request.QueryString["pnum"]);
        }

        if (!string.IsNullOrEmpty(Request.QueryString["cid"]))
        {
            contentId = Convert.ToInt64(Request.QueryString["cid"]);
        }

        if (!string.IsNullOrEmpty(Request.QueryString["selectedid"]))
        {
            selectedId = Convert.ToInt64(Request.QueryString["selectedid"]);
        }

        Ektron.Cms.API.Search.SearchManager search = new Ektron.Cms.API.Search.SearchManager();
        SearchRequestData requestData = new SearchRequestData();
        requestData.SearchFor = Ektron.Cms.WebSearch.SearchDocumentType.all;
        requestData.SearchText = text;
        requestData.PageSize = 10;
        requestData.LanguageID = languageID;
        requestData.CurrentPage = pageNumber;
        int resultCount = 0;
        SearchResponseData[] result = search.Search(requestData, HttpContext.Current, ref resultCount);
        StringBuilder str = new StringBuilder();
        StringBuilder strRet = new StringBuilder();
        int tmpCount = 0;
        string strLink = "";
        string[] arLink = null;
        MaxResults = requestData.PageSize;
        if (resultCount != 0)
        {
            str.Append("<table width=\"100%\" class=\"ektronGrid\">");
            foreach (SearchResponseData data in result)
            {
                strLink = "";
                strID = (string)("ek_sel_cont" + iLoop);
                if (data.QuickLink.IndexOf("http://") > -1)
                {
                    strLink = (string)(data.QuickLink);
                    strLink = strLink.Substring(7);
                    strLink = "http://" + strLink.Replace("\'", "\\\'").Replace("//", "/");
                }
                if (strLink.ToLower().IndexOf("window.open") < 0)
                {
                    arLink = strLink.Split("?".ToCharArray());
                    if (arLink.Length > 1)
                    {
                        strLink = arLink[0];
                        arLink = arLink[1].Split("&amp;".ToCharArray());
                        foreach (string val in arLink)
                        {
                            if (val.IndexOf("terms=") == -1)
                            {
                                if (strLink == "")
                                {
                                    strLink = val;
                                }
                                else
                                {
                                    if (strLink.IndexOf("?") < 0)
                                    {
                                        strLink = strLink + "?" + val;
                                    }
                                    else
                                    {
                                        strLink = strLink + "&" + val;
                                    }
                                }
                            }
                        }
                    }
                }

                strOnclick = "SelectContent(\'" + strID + "\',\'" + strLink + "\')";
                str.Append("<tr><td valign=\"top\" style=\"width:1%;\" valign=\"top\">");
                str.Append("<input type=\"radio\" ");
                if (selectedId != -1 && selectedId == data.ContentID)
                {
                    str.Append(" checked=\"true\" ");
                }

                if (data.ContentID == contentId)
                {
                    str.Append(" disabled ");
                }

                str.Append("onclick=\"" + strOnclick + "\" id=\"");
                str.Append(strID);
                str.Append("\" name=\"ek_sel_cont\"/></td><td valign=\"top\">");
                str.Append("<span onclick=\"" + strOnclick + "\" class=\"title\">");
                str.Append(data.Title).Append("</span><br/>");
                str.Append("<span onclick=\"SelectContent(\'" + strID + "\',\'" + strLink + "\')\" class=\"summary\">");
                if (data.ContentType != 2 && data.ContentType != 4)
                {
                    str.Append(data.Summary.Replace("<p> </p>", "").Replace("<p>&nbsp;</p>", "").Replace("<p>&#160;</p>", ""));
                }

                str.Append("</span></td></tr>");
                strFields.Append(",").Append(strID);
                iLoop++;
            }
        }

        if (resultCount > 0 && MaxResults > 0)
        {
            if (resultCount % MaxResults == 0)
            {
                totalPages = resultCount / MaxResults;
            }
            else
            {
                tmpCount = System.Convert.ToInt32(resultCount / MaxResults);
                if (tmpCount * MaxResults < resultCount)
                {
                    totalPages = tmpCount + 1;
                }
                else
                {
                    totalPages = tmpCount;
                }
            }
        }

        str.Append("</table>");
        if (totalPages == 0)
        {
            strRet = new StringBuilder();
            strRet.Append("<content>");
            strRet.Append("<table style=\"width:100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
            strRet.Append("<tr><td>" + m_refMsg.GetMessage("alt no related content") + "</td></tr>");
            strRet.Append("</table>");
            strRet.Append("</content>");
            strRet.Append("<totalPages>").Append(totalPages).Append("</totalPages>");
        }
        else
        {
            strRet.Append("<content>");
            strRet.Append("<div class=\"header\">" + m_refMsg.GetMessage("lbl total") + ": ").Append(resultCount).Append("<br/>");
            strRet.Append("" + m_refMsg.GetMessage("page lbl") + ": ").Append(pageNumber).Append(" " + m_refMsg.GetMessage("lbl of") + " ").Append(totalPages).Append("</div>");
            strRet.Append(str.ToString());
            strRet.Append("</content>");
            strRet.Append("<totalPages>").Append(totalPages).Append("</totalPages>");
        }

        Response.Write(strRet.ToString());
    }
Beispiel #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.RegisterWorkareaCssLink();
        this.RegisterDialogCssLink();
        Ektron.Cms.API.JS.RegisterJS(this, "../ContentDesigner/ekxbrowser.js", "ekxbrowserJS");
        Ektron.Cms.API.JS.RegisterJS(this, "../ContentDesigner/ekutil.js", "ekutilJS");
        Ektron.Cms.API.JS.RegisterJS(this, "../ContentDesigner/RadWindow.js", "RadWindowJS");
        this.ClientScript.RegisterClientScriptBlock(this.GetType(), "InitializeRadWindow",
            "InitializeRadWindow();  self.focus();", true);

        m_refMsg = m_refAPI.EkMsgRef;
        Utilities.ValidateUserLogin();
        titlePage.Text = m_refMsg.GetMessage("lbl imagetool edit title");
        if (!Page.IsPostBack) {
            // Information from the URL parameters
            if (null != Request.Params.Get("s"))
            {
                if (null != Session["ImageToolNewFile"])
                {
                    // save image clicked
                    // update the thumbnail for the image
                    Ektron.Cms.ImageTool.ImageTool imager = new Ektron.Cms.ImageTool.ImageTool();
                    string imagefilepath = (string) Session["ImageToolNewFile"];
                    string thumbfilepath = imagefilepath;
                    if (thumbfilepath.ToLower().EndsWith(".gif"))
                    {
                        thumbfilepath = thumbfilepath.Substring(0, thumbfilepath.LastIndexOf(".")) + ".png";
                    }
                    thumbfilepath = thumbfilepath.Substring(0, thumbfilepath.LastIndexOf("\\") + 1)
                        + "thumb_"
                        + thumbfilepath.Substring(thumbfilepath.LastIndexOf("\\") + 1);
                    /**** THIS IS NOW DONE in ImageScore.aspx.cs on CommitPersistentCommand
                    try
                    {
                        imager.Resize(125, -1, true, imagefilepath, thumbfilepath);
                    }
                    catch (IOException)
                    {
                        // the thumbnail service might be already updating the thumbnail
                        // so just ignore any I/O exceptions
                    }
                     */
                    // copy image to any load balance locations
                    Ektron.Cms.Library.EkLibrary refLib = m_refAPI.EkLibraryRef;
                    foreach (Microsoft.VisualBasic.Collection libpath in refLib.GetAllLBPaths("images"))
                    {
                        string relLBpath = (string) libpath["LoadBalancePath"];
                        string realLBpath = Server.MapPath(relLBpath);
                        string imgfilename = imagefilepath.Substring(imagefilepath.LastIndexOf("\\")+1);
                        string thumbnailfname = thumbfilepath.Substring(thumbfilepath.LastIndexOf("\\")+1);
                        try
                        {
                            File.Copy(imagefilepath, realLBpath + imgfilename);
                        }
                        catch (Exception) {}
                        try
                        {
                            File.Copy(thumbfilepath, realLBpath + thumbnailfname);
                        }
                        catch (Exception) { }
                    }
                    // clear out the session variable holding the new filename
                    Session["ImageToolNewFile"] = null;
                    Session["ImageToolNewFileUrl"] = null;
                    Session["ImageToolOldLibId"] = null;
                    Session["ImageToolOldLibContentId"] = null;
                    Session["ImageToolNewLibFileName"] = null;
                    Session["ImageToolLibFolderId"] = null;
                    Session["ImageToolAssetName"] = null;
                }
            }
            else if (null != Request.Params.Get("c"))
            {
                // cancel, so delete the new image file
                // then delete the session variable holding the new filename
                if (null != Session["ImageToolNewFile"])
                {
                    // get rid of library entry for image
                    Ektron.Cms.ContentAPI refContApi = getContentAPI();
                    refContApi.DeleteLibraryItemForImageTool((string)Session["ImageToolNewFileUrl"]);
                    if ((Session["ImageToolAssetName"] != null) && !((string)Session["ImageToolAssetName"]).StartsWith("thumb_"))
                    {
                        refContApi.DeleteAssetForImageTool((string)Session["ImageToolAssetName"]);
                    }
                    // get rid of image file
                    string imagefilepath = (string)Session["ImageToolNewFile"];
                    if (File.Exists(imagefilepath))
                    {
                        try
                        {
                            File.Delete(imagefilepath);
                        }
                        catch (IOException) { }
                    }
                    string thumbfilepath = imagefilepath;
                    if (thumbfilepath.ToLower().EndsWith(".gif"))
                    {
                        thumbfilepath = thumbfilepath.Substring(0, thumbfilepath.LastIndexOf(".")) + ".png";
                    }
                    thumbfilepath = thumbfilepath.Substring(0, thumbfilepath.LastIndexOf("\\") + 1)
                        + "thumb_"
                        + thumbfilepath.Substring(thumbfilepath.LastIndexOf("\\") + 1);
                    // and the thumbnail
                    if (File.Exists(thumbfilepath))
                    {
                        try
                        {
                            File.Delete(thumbfilepath);
                        }
                        catch (IOException) { }
                    }
                }
                Session["ImageToolNewFile"] = null;
                Session["ImageToolNewFileUrl"] = null;
                Session["ImageToolOldLibId"] = null;
                Session["ImageToolOldLibContentId"] = null;
                Session["ImageToolNewLibFileName"] = null;
                Session["ImageToolLibFolderId"] = null;
                Session["ImageToolAssetName"] = null;
            }
            else if (null != Request.Params.Get("i"))
            {
                string strValue = Page.Server.UrlDecode(Request.Params.Get("i")).Trim();
                if (!strValue.Contains("://"))
                {
                    // see if we're editing a thumbnailed image which comes in w/o a full URL
                    strValue = Request.Url.Scheme + "://" + Request.Url.Host +
                        ((((Request.Url.Scheme == "http") && (Request.Url.Port != 80)) ||
                        ((Request.Url.Scheme == "https") && (Request.Url.Port != 443))) ?
                        (":" + Request.Url.Port) : "")
                        + strValue;
                }
                if (strValue.Contains("://"))
                {
                    URL url = new URL(strValue);
                    URL myURL = new URL(Page.Request.Url.ToString());
                    strValue = url.Path;
                    if (strValue.StartsWith(":"))
                    {
                        // work around asp.net bug where url.path includes port# for path
                        strValue = strValue.Substring(strValue.IndexOf("/"));
                    }

                    // get info for old library item
                    string origImagePath = strValue;
                    bool fEditingThumbnail = false;
                    bool fIsAssetImage = false;
                    Ektron.Cms.ContentAPI refContApi = getContentAPI();
                    Ektron.Cms.LibraryData library_data = refContApi.GetLibraryItemByUrl(strValue);
                    if ((library_data == null) && strValue.Contains("thumb_"))
                    {
                        // this is a thumbnail so try to locate the image associated with it
                        // since we don't store the thumbnail path in the DB
                        origImagePath = strValue.Replace("thumb_", "");
                        library_data = refContApi.GetLibraryItemByUrl(origImagePath);
                        if (library_data == null)
                        {
                            // thumbnails are PNG files so see if the original was a JPEG or GIF
                            string[] imageexts = { ".jpg", ".gif" };
                            foreach (string ext in imageexts)
                            {
                                string origImageGuess = origImagePath.Replace(".png", ext);
                                library_data = refContApi.GetLibraryItemByUrl(origImageGuess);
                                if (library_data != null)
                                {
                                    origImagePath = origImageGuess;
                                    break;
                                }
                            }
                        }
                        fEditingThumbnail = true;
                    }
                    if (library_data == null)
                    {
                        panelMessage.Visible = true;
                        lblMessage.Text = m_refMsg.GetMessage("err imagetool unable to find image") + strValue;
                        imagetool.Visible = false;
                        return;
                    }
                    long folderid = library_data.ParentId;
                    if ((library_data.ParentId == 0) && (library_data.ContentId != 0))
                    {
                        // this is a DMS asset, so look up the folder it belongs in
                        folderid = refContApi.GetFolderIdForContentId(library_data.ContentId);
                        fIsAssetImage = true;
                    }
                    Ektron.Cms.PermissionData security_data = refContApi.LoadPermissions(folderid, "folder", Ektron.Cms.ContentAPI.PermissionResultType.Common);
                    Ektron.Cms.PermissionData usersecurity_data = refContApi.LoadPermissions(refContApi.UserId, "users", Ektron.Cms.ContentAPI.PermissionResultType.All);
                    if (!security_data.CanAddToImageLib && !usersecurity_data.IsAdmin)
                    {
                        panelMessage.Visible = true;
                        lblMessage.Text = m_refMsg.GetMessage("err imagetool no library permission");
                        imagetool.Visible = false;
                        return;
                    }

                    // generate new filename
                    if ((url.HostName == myURL.HostName) || (url.HostName.ToLower() == "localhost"))
                    {
                        string strFilePath = null;
                        try
                        {
                            strFilePath = Server.MapPath(origImagePath);
                        }
                        catch (Exception)
                        {
                            panelMessage.Visible = true;
                            lblMessage.Text = m_refMsg.GetMessage("err imagetool non site image");
                            imagetool.Visible = false;
                            return;
                        }
                        string strNewFilePath = strFilePath;
                        if (File.Exists(strFilePath))
                        {
                            FileInfo fileinfo = new FileInfo(strFilePath);
                            // name the file "<oldname>.N.<extension>"
                            string origfname = fileinfo.Name;
                            string fname = origfname;
                            string newfname = fname;
                            do
                            {
                                string[] fnamepieces = fname.Split(new char[] { '.' });
                                newfname = fname;
                                if (fnamepieces.Length > 2)
                                {
                                    // loop until we find one that doesn't exist
                                    string strCurVer = fnamepieces[fnamepieces.Length - 2];
                                    string strExt = fnamepieces[fnamepieces.Length - 1];
                                    int newVer = int.Parse(strCurVer) + 1;
                                    newfname = fname.Replace("." + strCurVer + "." + strExt, "." + newVer + "." + strExt);
                                }
                                else if (fnamepieces.Length == 2)
                                {
                                    newfname = fnamepieces[0] + ".1." + fnamepieces[1];
                                }
                                else
                                {
                                    // not sure what to do w/ filename w/ no extension???
                                }
                                strNewFilePath = strNewFilePath.Replace(fname, newfname);
                                fileinfo = new FileInfo(strNewFilePath);
                                if (fileinfo.Exists)
                                {
                                    fname = fileinfo.Name;
                                }
                            } while (fileinfo.Exists);
                            if (strFilePath != strNewFilePath)
                            {
                                File.Copy(strFilePath, strNewFilePath);
                                strValue = origImagePath.Replace(origfname, newfname);
                                // save new filename so we can clean it up when user clicks on "cancel" button
                                Session["ImageToolNewFile"] = strNewFilePath;
                                // save URL so we can delete it from the library
                                Session["ImageToolNewFileUrl"] = strValue;
                                // save asset filename if we it's an asset
                                Session["ImageToolAssetName"] = null;
                                if (fIsAssetImage)
                                {
                                    Session["ImageToolAssetName"] = newfname;
                                }

                                if (library_data != null)
                                {
                                    // save tags and metadata for original image
                                    Ektron.Cms.TagData[] oldtags = null;
                                    Ektron.Cms.Community.TagsAPI refTagsApi = new Ektron.Cms.Community.TagsAPI();
                                    Ektron.Cms.ContentMetaData[] oldmeta = null;
                                    if (library_data.Id > 0)
                                    {
                                        Session["ImageToolOldLibId"] = library_data.Id;
                                        Session["ImageToolOldLibContentId"] = library_data.ContentId;
                                        oldtags = refTagsApi.GetTagsForObject(library_data.Id,
                                            Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.Library,
                                            refContApi.ContentLanguage);
                                        if (library_data.ContentId != 0) {
                                            Ektron.Cms.ContentData content_data = refContApi.GetContentById(library_data.ContentId,
                                                Ektron.Cms.ContentAPI.ContentResultType.Published);
                                            if (content_data != null)
                                            {
                                                oldmeta = content_data.MetaData;
                                            }
                                        } else {
                                            oldmeta = library_data.MetaData;
                                        }
                                    }
                                    // create new image to edit
                                    library_data.Id = 0;
                                    if (fEditingThumbnail)
                                    {
                                        origfname = new FileInfo(origImagePath).Name;
                                        library_data.FileName = library_data.FileName.Replace(origfname, newfname);
                                    }
                                    else
                                    {
                                        library_data.FileName = library_data.FileName.Replace(origfname, newfname);
                                    }
                                    library_data.ParentId = folderid;
                                    Session["ImageToolNewLibFileName"] = library_data.FileName;
                                    Session["ImageToolLibFolderId"] = library_data.ParentId;
                                    long newLibId = refContApi.AddLibraryItemForImageTool(ref library_data);
                                    if (fIsAssetImage && !newfname.StartsWith("thumb_"))
                                    {
                                        // only need to add this for assets, not thumbnail of assets
                                        refContApi.AddAssetForImageTool(origfname, newfname);
                                    }
                                    // add original tags/metadata to new image
                                    if (oldtags != null) {
                                        foreach (Ektron.Cms.TagData tag in oldtags)
                                        {
                                            refTagsApi.AddTagToObject(tag.Id, newLibId,
                                                  Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.Library,
                                                  -1, refContApi.ContentLanguage);
                                        }
                                    }
                                    if (oldmeta != null)
                                    {
                                         refContApi.UpdateLibraryMetadataByID(newLibId, oldmeta);
                                    }
                                }

                                // can't show filenames or it'll be too long and the DMS filenames are ugly
                            //titlePage.Text = m_refMsg.GetMessage("lbl imagetool edit title") + ": " + origfname;
                            }
                        }
                        imagetool.Edit(strValue);
                    }
                    else
                    {
                        panelMessage.Visible = true;
                        lblMessage.Text = m_refMsg.GetMessage("err imagetool non site image");
                        imagetool.Visible = false;
                    }
                }
            }
        }
    }
Beispiel #20
0
 /// <summary>
 /// Set member variable defaults
 /// </summary>
 protected List()
 {
     _SearchText = String.Empty;
     _MessageHelper = _ContentApi.EkMsgRef;
 }
Beispiel #21
0
 public EkConnections(System.Collections.Specialized.NameValueCollection webSystemSettings)
 {
     m_webSystemSettings = new System.Collections.Specialized.NameValueCollection(webSystemSettings);
     m_refMsg = (new Ektron.Cms.ContentAPI()).EkMsgRef;
 }
Beispiel #22
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronJS);
        Ektron.Cms.API.JS.RegisterJS(this, m_refContentApi.AppPath + "java/dateParser.js", "DateJS");

        m_refMsg = m_refContentApi.EkMsgRef;
        Save.ToolTip = Save.Text = m_refMsg.GetMessage("generic save");
        ToolBar();

        if (!string.IsNullOrEmpty(Request.QueryString["widgetid"]))
        {
            if (!long.TryParse(Request.QueryString["widgetid"], out m_widgetID))
            {
                ShowError("Could not find that widget");
                return;
            }
        }

        if (m_widgetID > -1)
        {
            if (!m_refWidgetModel.FindByID(m_widgetID, out info))
            {
                ShowError("Could not find that widget");
                return;
            }
        }

        if (info != null)
        {
            lblID.Text = info.ID.ToString();
            lblID.ToolTip = lblID.Text;
            lblFilename.Text = info.ControlURL;
            lblFilename.ToolTip = lblFilename.Text;
            txtTitle.Text = info.Title;
            txtTitle.ToolTip = txtTitle.Text;
            txtLabel.Text = info.ButtonText;
            txtLabel.ToolTip = txtLabel.Text;

            //get properties marked as global settings and fill in table
            LoadWidgetGlobalProps();
            SetupPropertyEditor();

            viewset.SetActiveView(viewSettings);

            if (Page.IsPostBack)
            {
                SaveProperties(null, null);
            }
        }
        else
        {
            ShowError("Unknown error");
            return;
        }
    }
Beispiel #23
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        Ektron.Cms.ContentAPI refContApi = new Ektron.Cms.ContentAPI();
        Ektron.Cms.SiteAPI refSiteApi = new Ektron.Cms.SiteAPI();
        Ektron.Cms.Site.EkSite refSite = new Ektron.Cms.Site.EkSite(refContApi.RequestInformationRef);
        long folder = 0;
        @internal.Text = refSite.GetEditorInternal();
        if (LCaseQueryString("mode") == "forum")
        {
            strButtons = Request.QueryString["toolButtons"];
            string[] arTools = strButtons.ToLower().Split(",".ToCharArray());
            foreach (string Item in arTools)
            {
                if (!(options.ContainsKey(Item)))
                {
                    options.Add(Item, Item);
                }
            }
        }
        Response.ContentType = "text/xml";
        m_refMsg = refSiteApi.EkMsgRef;
        settings_data = refSiteApi.GetSiteVariables(-1);
        refSite = refContApi.EkSiteRef;
        FontList = refContApi.GetFontConfigList();
        EKSLK = refSite.GetInternal();
        AppeWebPath = refContApi.AppPath + refContApi.AppeWebPath;

        if (LCaseQueryString("FormToolbarVisible") == "true")
        {
            FormToolbarVisible = "true";
            FormToolbarEnabled = "true";
        }
        else
        {
            FormToolbarVisible = "false";
            FormToolbarEnabled = "true";
        }
        if ("0" == LCaseQueryString("wiki"))
        {
            bWikiButton = bool.Parse("false");
        }
        else
        {
            bWikiButton = bool.Parse("true");
        }
        //Set the state for word styles
        if (settings_data.PreserveWordStyles == true)
        {
            PresWrdStyl = "true";
        }
        else
        {
            PresWrdStyl = "false";
        }
        if (settings_data.PreserveWordClasses == true)
        {
            PresWrdCls = "true";
        }
        else
        {
            PresWrdCls = "false";
        }
        switch (settings_data.Accessibility)
        {
            case "1":
                sAccess = "loose";
                bAccessEval = "true";
                break;
            case "2":
                sAccess = "strict";
                bAccessEval = "true";
                break;
            default:
                sAccess = "none";
                bAccessEval = "false";
                break;
        }
        NoSrcView = LCaseQueryString("nosrc");
        mode = LCaseQueryString("mode");
        if (mode == "")
        {
            mode = "wysiwyg";
        }

        if (mode == "forum")
        {
            mode = "wysiwyg";
            IsForum = true;
        }

        if ("datadesign" == mode || "dataentry" == mode)
        {
            DefaultGetContentType = "datadesignpackage";
        }
        else if ("formdesign" == mode)
        {
            DefaultGetContentType = "designpage";
        }

        ExtUI = LCaseQueryString("extui");

        InterfaceName = LCaseQueryString("InterfaceName");
        if ("" == InterfaceName)
        {
            if ("datadesign" == mode || "formdesign" == mode || "dataentry" == mode)
            {
                InterfaceName = mode;
                FormToolbarEnabled = "false";
            }
            else
            {
                InterfaceName = "standard";
            }
        }
        else if ("none" == InterfaceName)
        {
            MinimalFeatureSet = false;
            FormToolbarEnabled = "false";
        }
        else if ("minimal" == InterfaceName || "calendar" == InterfaceName || "task" == InterfaceName)
        {
            if (strButtons.Length > 0 && true == options.ContainsKey("wmv"))
            {
                MinimalFeatureSet = false;
            }
            else
            {
                MinimalFeatureSet = true;
            }
            FormToolbarEnabled = "false";
        }

        if (settings_data.EnableFontButtons || true == options.ContainsKey("fontmenu"))
        {
            bEnableFontButtons = true;
        }

        string strFolder;
        strFolder = Request.QueryString["folder"];
        if (strFolder != null)
        {
            if (Information.IsNumeric(strFolder))
            {
                folder = Convert.ToInt64(strFolder);
            }
        }
        Ektron.Cms.LibraryConfigData lib_settings;
        extensions = "";
        try
        {
            // Only make this call if we are logged in
            Ektron.Cms.ContentAPI refContentApi = new Ektron.Cms.ContentAPI();
            Ektron.Cms.Content.EkContent refContent;
            refContent = refContentApi.EkContentRef;

            if (refContent.IsAllowed(0, 0, "users", "IsLoggedIn", 0))
            {
                // An exception will be thrown if the user is not authenticated.
                lib_settings = refContApi.GetLibrarySettings(folder);
                if (lib_settings != null)
                {
                    extensions = lib_settings.ImageExtensions + "," + lib_settings.FileExtensions;
                }
            }
        }
        catch (Exception)
        {
            // ignore error
        }

        ContentLanguage = refContApi.RequestInformationRef.ContentLanguage;

        PopulateDataLists(refContApi);
    }
Beispiel #24
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        Ektron.Cms.Content.EkContent objContentRef;
        objContentRef = m_refContentApi.EkContentRef;

        // register JS and CSS
        RegisterResources();
        jsStyleSheet.Text = (new StyleHelper()).GetClientScript();
        m_refMsg = (new Ektron.Cms.CommonApi()).EkMsgRef;
        if ((Convert.ToBoolean(m_refContentApi.RequestInformationRef.IsMembershipUser) || m_refContentApi.RequestInformationRef.UserId == 0 || !m_refContentApi.EkUserRef.IsAllowed(m_refContentApi.UserId, 0, "users", "IsAdmin", 0)) && !(objContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SearchAdmin, m_refContentApi.UserId, false)))
        {
            Response.Redirect(m_refContentApi.ApplicationPath + "Login.aspx", true);
            return;
        }

        if (!IsSearchConfigured())
        {
            Utilities.ShowError(m_refMsg.GetMessage("msg search suggested results connection error"));
        }
        else
        {

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

            if (!string.IsNullOrEmpty(Request.QueryString["termID"]))
            {
                suggestedResultID = Request.QueryString["termID"];
            }

            jsSuggestedResultID.Text = suggestedResultID;
            jsPageAction.Text = strPageAction;
            jsDelResultSet.Text = m_refMsg.GetMessage("js confirm delete suggested result set");
            jsDelResult.Text = m_refMsg.GetMessage("js confirm delete suggested result");
            jsDelResultEdit.Text = m_refMsg.GetMessage("js confirm delete suggested result edit");
            //jsResultTerm.Text = m_refMsg.GetMessage("lbl suggested result term");
            //jsTypeOpt2.Text = m_refMsg.GetMessage("msg suggestedresults type option2");
            jsLinkReq.Text = m_refMsg.GetMessage("js link required");
            jsTitleReq.Text = m_refMsg.GetMessage("js title required");
            jsSummaryReq.Text = m_refMsg.GetMessage("js summary required");
            jsSizeExceeded.Text = m_refMsg.GetMessage("js summary size exceeded");
            jsTermReq.Text = m_refMsg.GetMessage("js term required");
            jsTermNoCommas.Text = m_refMsg.GetMessage("js terms no commas");
            jsTermsNoParenthesis.Text = m_refMsg.GetMessage("js terms no parenthesis");
            jsSynonymSetReq.Text = m_refMsg.GetMessage("js synonym set required");
            jsSugResultReq.Text = m_refMsg.GetMessage("js one or more suggested results required");
            try
            {
                switch (strPageAction)
                {
                    case "viewsuggestedresults":
                        // reference viewsuggestedresults.ascx
                        objViewSuggestedResults = (Workarea_controls_search_viewsuggestedresults)(LoadControl("../controls/search/viewsuggestedresults.ascx"));
                        objViewSuggestedResults.ID = "viewsuggestedresults";
                        DataHolder.Controls.Add(objViewSuggestedResults);
                        break;

                    case "addsuggestedresult":
                        // reference addsuggestedresults.ascx
                        objAdd = (Workarea_controls_search_addsuggestedresult)(LoadControl("../controls/search/addsuggestedresult.ascx"));
                        objAdd.ID = "addsuggestedresult";
                        DataHolder.Controls.Add(objAdd);
                        break;

                    case "viewsuggestedresult":
                        // reference viewsuggestedresults.ascx
                        objView = (Workarea_controls_search_viewsuggestedresult)(LoadControl("../controls/search/viewsuggestedresult.ascx"));
                        objAdd.ID = "viewsuggestedresult";
                        DataHolder.Controls.Add(objView);
                        break;

                    case "editsuggestedresult":
                        // reference addsuggestedresults.ascx
                        objAdd = (Workarea_controls_search_addsuggestedresult)(LoadControl("../controls/search/addsuggestedresult.ascx"));
                        objAdd.ID = "addsuggestedresult";
                        DataHolder.Controls.Add(objAdd);
                        break;

                    case "deletesuggestedresult":
                        // reference addsuggestedresults.ascx
                        objDelete = (Workarea_controls_search_deletesuggestedresults)(LoadControl("../controls/search/deletesuggestedresults.ascx"));
                        objDelete.ID = "deletesuggestedresult";
                        DataHolder.Controls.Add(objDelete);
                        break;
                }
            }
            catch (Exception ex)
            {
                Utilities.ShowError(ex.Message);
            }
        }
    }
Beispiel #25
0
 protected string GetMessage(string key)
 {
     if (null == _msgHelper){
         SiteAPI siteApi = new SiteAPI();
         _msgHelper = siteApi.EkMsgRef;
     }
     return _msgHelper.GetMessage(key);
 }
Beispiel #26
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        try
        {
            m_refMsg = m_refContApi.EkMsgRef;

            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    m_refContApi.SetCookieValue("LastValidLanguageID", m_intContentLanguage.ToString());
                }
                else
                {
                    if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
                }
            }

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

            if (!(Request.QueryString["id"] == null))
            {
                m_intId = Convert.ToInt64(Request.QueryString["id"]);
            }

            if (m_intId != -1)
            {

                m_contentType = m_refContApi.EkContentRef.GetContentType(m_intId);

                switch (m_contentType)
                {

                    case Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry:

                        Ektron.Cms.Commerce.CatalogEntryApi m_refCatalogAPI = new Ektron.Cms.Commerce.CatalogEntryApi();
                        List<Ektron.Cms.Commerce.EntryData> entry_version_list = new List<Ektron.Cms.Commerce.EntryData>();
                        //causes cms400.sln compile to fail: entry_version_list = m_refCatalogAPI.GetVersionList(m_intId, m_intContentLanguage);
                        populateEntryGrid(entry_version_list);
                        break;

                    default:

                        ContentHistoryData[] content_history_list = (ContentHistoryData[])Array.CreateInstance(typeof(ContentHistoryData), 0);
                        content_history_list = m_refContApi.GetHistoryList(m_intId);
                        populateContentGrid(content_history_list);
                        break;
                }
            }
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }
Beispiel #27
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        RegisterResources();
            //StyleSheetJS.Text = (new StyleHelper()()).GetClientScript;
            StyleHelper sh = new StyleHelper();
            StyleSheetJS.Text = sh.GetClientScript();
            m_refMsg = (new CommonApi()).EkMsgRef;
            if (!(Request.QueryString["action"] == null))
            {
                if (Request.QueryString["action"] != "")
                {
                    m_strPageAction = Request.QueryString["action"].ToLower();
                }
            }
            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    m_refApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                }
                else
                {
                    if (m_refApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID"));
                }
            }

            try
            {
                Ektron.Cms.ContentAPI m_refContentApi = new Ektron.Cms.ContentAPI();
                if (! Utilities.ValidateUserLogin())
                {
                    return;
                }
                if (! m_refContentApi.IsAdmin())
                {
                    Response.Redirect((string) ("reterror.aspx?info=" + m_refContentApi.EkMsgRef.GetMessage("msg login cms administrator")), false);
                    return;
                }
                switch (m_strPageAction)
                {
                    case "managecustompermissions":
                        m_customroles = (customroles) (LoadControl("controls/roles/customroles.ascx"));
                        DataHolder.Controls.Add(m_customroles);
                        break;

                    default:
                        m_rolemembermgr = (rolemembermgr) (LoadControl("controls/roles/rolemembermgr.ascx"));
                        m_rolemembermgr.ID  = "role";
                        DataHolder.Controls.Add(m_rolemembermgr);
                        break;
                }
            }
            catch (Exception ex)
            {
                Utilities.ShowError(ex.Message);
            }
    }
Beispiel #28
0
        /// <summary>
        /// Gets localized string given a key. The localized string is from the Ektron CMS resource.
        /// </summary>
        /// <param name="key">ID of string</param>
        /// <returns>Localized string</returns>
        protected string GetMessage(string key)
        {
            if (null == this.refMsg)
            {
                this.refMsg = this.GetCommonApi().EkMsgRef;
            }

            return this.refMsg.GetMessage(key);
        }
Beispiel #29
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        if (!(Request.QueryString["grouptype"] == null) && Request.QueryString["grouptype"] != "")
        {
            m_intGroupType = Convert.ToInt32(Request.QueryString["grouptype"]);
        }
        if ((!(Request.QueryString["action"] == null)) && (Request.QueryString["action"] != ""))
        {
            m_strPageAction = Request.QueryString["action"].ToLower();
        }
        if ((!(Request.QueryString["id"] == null)) && (Request.QueryString["id"] != ""))
        {
            uId = Convert.ToInt64(Request.QueryString["id"]);
        }

        m_refMsg = m_refContentApi.EkMsgRef;
        AppImgPath = m_refSiteApi.AppImgPath;
        ContentLanguage = m_refSiteApi.ContentLanguage;
        m_strDirection = Request.QueryString["direction"];
        if (m_strDirection == "asc")
        {
            m_strDirection = "desc";
        }
        else
        {
            m_strDirection = "asc";
        }
        VisiblePageControls(false);
        if (m_strPageAction == "addusertogroup")
        {
            AddUserToGroup();
        }
        RegisterResources();
    }
Beispiel #30
0
 private void Page_Load(System.Object sender, System.EventArgs e)
 {
     RegisterResources();
     jsUniqueID.Text = "editconfiguration";
     m_refMsg = (new CommonApi()).EkMsgRef;
 }