Beispiel #1
0
    /// <summary>
    /// This subroutine accepts an integer indicating the current ContentLanguage specified by the user, and then outputs the current Synonym Sets stored in the CMS to the workarea.  The Keywords associated with each Synonym Set will be truncated in the output so that only one line of terms will be displayed.  A "title" attribute provides the entire list of terms on mouseover.
    /// </summary>
    /// <param name="ContentLanguage">An integer representing the current user selected language for the content.</param>
    /// <remarks></remarks>
    protected void OutputSynonymSets(int ContentLanguage, Literal  objLiteral)
    {
        Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();
            try
            {
                List<SynonymData> synonymSetData = GetSynonyms(ContentLanguage);

                if (synonymSetData == null)
                {
                    throw (new Exception(m_refMsg.GetMessage("generic no results found")));
                }

                objLiteral.Text = "<table id=\"viewSynonymSets\" class=\"ektronGrid\">";

                objLiteral.Text += "<tr class=\"title-header\">" + "\r\n";
                objLiteral.Text += "<th class=\"left\">" + m_refMsg.GetMessage("lbl synonym header set") + "</th>" + "\r\n";
                objLiteral.Text += "<th class=\"center\">" + m_refMsg.GetMessage("generic language") + "</th>" + "\r\n";
                objLiteral.Text += "</tr>" + "\r\n";

                foreach (SynonymData synonymSet in synonymSetData)
                {
                    //TODO: Pinkesh - Add row striping
                    objLiteral.Text += "<tr class=\"row\">" + "\r\n";
                    objLiteral.Text += "<td><a href=\"synonyms.aspx?id=" + synonymSet.ID.ToString() + "&#38;LangType=" + synonymSet.LanguageID + "&#38;action=ViewSynonym&#38;bck=vs\">" + EkFunctions.HtmlEncode(synonymSet.Name) + "</td>" + "\r\n";
                    objLiteral.Text += "<td  class=\"center\"><img style=\'vertical-align:middle;\' src=\'" + objLocalizationApi.GetFlagUrlByLanguageID(synonymSet.LanguageID) + "\' title=\'" + synonymSet.LanguageID + "\' alt=\'" + synonymSet.LanguageID + "\' /></td>";
                    objLiteral.Text += "</tr>" + "\r\n";
                }
                objLiteral.Text += "</table>" + "\r\n";
            }
            catch
            {
                Utilities.ShowError(m_refMsg.GetMessage("msg search synonyms connection error"));
            }
    }
Beispiel #2
0
 protected void Page_Init(object sender, EventArgs e)
 {
     _host = Ektron.Cms.Widget.WidgetHost.GetHost(this);
     _host.Title = "YouTubeVideo Widget";
     _host.Edit += new EditDelegate(EditEvent);
     _host.Create += new CreateDelegate(delegate() { EditEvent(""); });
     PreRender += new EventHandler(delegate(object PreRenderSender, EventArgs Evt) { SetOutput(); });
     Ektron.Cms.CommonApi _api = new Ektron.Cms.CommonApi();
     Ektron.Cms.API.JS.RegisterJSInclude(tbData, Ektron.Cms.API.JS.ManagedScript.EktronJS);
     Ektron.Cms.API.JS.RegisterJSInclude(tbData, _api.SitePath + "widgets/YouTubeVideo/js/YouTubeVideo.js", "EktronWidgetYouTubeJS");
     Ektron.Cms.API.Css.RegisterCss(tbData, _api.SitePath + "widgets/YouTubeVideo/css/YouTubeVideo.css", "YouTubecss");
     appPath = _api.AppPath;
     ViewSet.SetActiveView(View);
 }
Beispiel #3
0
        /// <summary>
        /// Get all the Enabled locales from CMS.
        /// </summary> 
        private void PopulateLocaleGrid()
        {
            string applicationpath = new Ektron.Cms.CommonApi().ApplicationPath;
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronStringJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronXmlJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronSmartFormJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, applicationpath + "java/ektron.workarea.js", "ektronWorkareaJS");
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../ekxbrowser.js", "ekxbrowserJS");
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../ekutil.js", "ekutilJS");
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../RadWindow.js", "RadWindowJS");
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../ekformfields.js", "ekformfieldsJS");
            Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronJFunctJS);
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "InitializeRadWindow", "InitializeRadWindow();", true);
            EnabledLocaleList.Columns.Add(this.styleHelper.CreateBoundField("Include", this.GetMessage("lbl include locales header for content"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            EnabledLocaleList.Columns.Add(this.styleHelper.CreateBoundField("Exclude", this.GetMessage("lbl exclude locales header for content"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            EnabledLocaleList.Columns.Add(this.styleHelper.CreateBoundField("Combined Name", this.GetMessage("lbl Name"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(30), Unit.Percentage(30), false, false));
            EnabledLocaleList.Columns.Add(this.styleHelper.CreateBoundField("Loc", this.GetMessage("lbl loc header for content"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(30), Unit.Percentage(30), false, false));
            EnabledLocaleList.Columns.Add(this.styleHelper.CreateBoundField("Id", this.GetMessage("lbl id header of locale for content"), "title-header", HorizontalAlign.Right, HorizontalAlign.Right, Unit.Percentage(30), Unit.Percentage(30), false, false));
            DataTable localeDataTable = new DataTable();
            DataRow localeDataRow = default(DataRow);
            localeDataTable.Columns.Add(new DataColumn("Include", typeof(string)));
            localeDataTable.Columns.Add(new DataColumn("Exclude", typeof(string)));
            localeDataTable.Columns.Add(new DataColumn("Combined Name", typeof(string)));
            localeDataTable.Columns.Add(new DataColumn("Loc", typeof(string)));
            localeDataTable.Columns.Add(new DataColumn("Id", typeof(string)));
            Ektron.Cms.Framework.Localization.LocaleManager localeApi = new Ektron.Cms.Framework.Localization.LocaleManager();
            List<LocaleData> locales = localeApi.GetEnabledLocales();
            if (locales.Count > 0)
            {
                for (int b = 0; b < locales.Count; b++)
                {
                    string includeMessage = this.GetMessage("lbl include locales title for include checkbox of localization");
                    string excludeMessage = this.GetMessage("lbl exclude locales title for include checkbox of localization");
                    localeDataRow = localeDataTable.NewRow();
                    localeDataRow["Include"] = "<input type=\"checkbox\" title=\"" + includeMessage + "\" class=" + locales[b].Id + " name=\"include_items\" id=\"include_items" + locales[b].Id + "\" value=\"" + locales[b].Loc + "\" onclick=\"disableIncludeCheck('exclude_items" + locales[b].Id + "','include_items" + locales[b].Id + "');\">";
                    localeDataRow["Exclude"] = "<input type=\"checkbox\" title=\"" + excludeMessage + "\" class=" + locales[b].Id + " name=\"exclude_items\" id=\"exclude_items" + locales[b].Id + "\" value=\"" + locales[b].Loc + "\" onclick=\"disableIncludeCheck('include_items" + locales[b].Id + "','exclude_items" + locales[b].Id + "');\">";
                    localeDataRow["Combined Name"] = "<img title=" + locales[b].EnglishName + " alt=" + locales[b].EnglishName + " src='" + this.objLocalizationApi.GetFlagUrlByLanguageID(locales[b].Id) + "' />&nbsp;&nbsp;&nbsp;" + locales[b].CombinedName;
                    localeDataRow["Loc"] = locales[b].Loc;
                    localeDataRow["Id"] = locales[b].Id;
                    localeDataTable.Rows.Add(localeDataRow);
                }
            }

            DataView dataView = new DataView(localeDataTable);
            EnabledLocaleList.DataSource = dataView;
            EnabledLocaleList.DataBind();
        }
Beispiel #4
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();
         Utilities.ValidateUserLogin();
         if (!(api.UserId > 0) || (api.RequestInformationRef.IsMembershipUser > 0))
         {
             Utilities.ShowError("User authentication denied.");
         }
         if (!String.IsNullOrEmpty(Request.QueryString["type"]))
         {
             objectType = Request.QueryString["type"];
         }
         if (objectType == "preview")
         {
             wfimageUrl = api.AppPath + "/wfactivities.png?type=" + Request.QueryString["id"];
         }
         else
         {
             if (!String.IsNullOrEmpty(Request.QueryString["id"]))
             {
                 objectId = Convert.ToInt64(Request.QueryString["id"]);
             }
             if (objectId > 0)
             {
                 IOrderManager om = ObjectFactory.GetOrderManager();
                 instanceId = om.GetItem(objectId).WorkflowId;
                 wfimageUrl = api.AppPath + "/wfactivities.png?instanceid=" + instanceId.ToString();
             }
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.ToString());
     }
 }
    protected void btnNext_Click(object sender, System.EventArgs e)
    {
        Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();
            string desc = "";
            int width = 800;
            string address = "";
            int isimage = 0;
            this.panelImageProperties.Visible = true;
            this.panelDragDrop.Visible = false;
            if (Request.QueryString["prop"] == "image")
            {
                isimage = 1;
            }
            if ((Request.QueryString["type"] != null)&& Request.QueryString["type"] == "update")
            {
                long id = 0;
                if (Request.QueryString["id"] != null)
                {
                    id = Convert.ToInt64(Request.QueryString["id"]);

                    Ektron.Cms.ContentEditData data;
                    Ektron.Cms.ContentAPI apiContent = new Ektron.Cms.ContentAPI();
                    int metaId = 0;
                    data = apiContent.GetContentForEditing(id);
                    if (this.ekImagegalleryTitle.Value.IndexOf("<") != -1 || this.ekImagegalleryTitle.Value.IndexOf(">") != -1 || this.ekImagegalleryTitle.Value.IndexOf("\'") != -1 || this.ekImagegalleryTitle.Value.IndexOf("\"") != -1)
                    {
                        this.ekImagegalleryTitle.Value = this.ekImagegalleryTitle.Value.Replace("<", "").Replace(">", "").Replace("\'", "").Replace("\"", "");
                    }
                    data.Title = (string) this.ekImagegalleryTitle.Value;
                    data.Teaser = (string) ctlEditor.Content;
                    content_teaser.Value = ctlEditor.Content;
                    data.FileChanged = false;
                    apiContent.SaveContent(data);
                    if (Request.QueryString["prop"] == "image")
                    {
                        isimage = 1;
                        foreach (Ektron.Cms.ContentMetaData item in data.MetaData)
                        {
                            if (item.TypeName.ToLower() == "mapaddress")
                            {
                                metaId = Convert.ToInt32(item.TypeId);
                                break;
                            }
                        }
                        if (metaId > 0)
                        {
                            apiContent.UpdateContentMetaData(data.Id, metaId, (string) this.ekImagegalleryAddress.Value);
                        }
                    }
                    apiContent.PublishContentById(id, data.FolderId, data.LanguageId, "", api.UserId, "");
                    this.ctlEditor.Visible = false; //so that the content designer will not be initialized again.
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close_box", "Close();", true);
                }
            }
            else
            {
                desc = (string) ctlEditor.Content;
                if (Request.Form["ekImagegalleryImageWidth"] != null)
                {
                    width = System.Convert.ToInt32(Request.Form["ekImagegalleryImageWidth"].ToString());
                }
                if (Request.Form["ekImagegalleryAddress"] != null)
                {
                    address = (string) (Request.Form["ekImagegalleryAddress"].ToString());
                }

                string[] imageProp = new string[4];
                imageProp[0] = width.ToString(); //width
                imageProp[1] = "-1"; //height
                imageProp[2] = address; //mapaddress
                imageProp[3] = desc; //Descriptions

                Ektron.ASM.EkDavProtocol.Constants.GetCustomCacheManger().Remove(api.UserId.ToString() + "_" + api.UniqueId.ToString() + "_MapMeta");
                Ektron.ASM.EkDavProtocol.Constants.GetCustomCacheManger().Add(api.UserId.ToString() + "_" + api.UniqueId.ToString() + "_MapMeta", imageProp);

                this.ctlEditor.Visible = false; //so that the content designer will not be initialized again.
                string _doHide = string.Empty;
                string _galleryString = string.Empty;
                if (! (Request.QueryString["hidecancel"] == null) && Request.QueryString["hidecancel"] == "true")
                {
                    _doHide = "&hidecancel=true";
                }
                if (! (Request.QueryString["isimagegallery"] == null) && Request.QueryString["isimagegallery"] == "true")
                {
                    _galleryString = "&isimagegallery=true";
                }

                Response.Redirect(m_refContApi.AppPath + "DragDropCtl.aspx?mode=0&folder_id=" + Request.QueryString["folderiD"] + "&lang_id=" + m_refContApi.ContentLanguage + "&TaxonomyId=" + Request.QueryString["TaxonomyId"] + "&isimage=" + isimage + _doHide + _galleryString);
            }
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
            {
                Session["EkDavSessionVal"] = null;
            }
            m_refMsg = m_refContApi.EkMsgRef;
            Utilities.ValidateUserLogin();
            RegisterResources();
            aHelp.HRef = "#Help";
            aHelp.Attributes.Add("onclick", "window.open('" + m_refContApi.fetchhelpLink("add_assets") + "', '', 'width=800,height=500,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');return false;");
            setLocalizedStrings();
            if (Request.QueryString["folderiD"] != null)
            {
                _folderID = Convert.ToInt64(Request.QueryString["folderID"]);
                jsFolderID.Text = _folderID.ToString();

            }

            if (Request.QueryString["TaxonomyId"] != null)
            {
                _taxonomyID = Convert.ToInt64(Request.QueryString["TaxonomyId"]);
                jsTaxonomyId.Text = _taxonomyID.ToString();
                jsTaxonomyIdReloadFrame.Text = _taxonomyID.ToString();
                jsTaxID.Text = _taxonomyID.ToString();
                isMetadataOrTaxonomyRequired = true;
            }

            if (Request.QueryString["LangType"] != null)
            {
                _contentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                jsLanguageID.Text = _contentLanguage.ToString();
            }

            if (m_refContApi.EkContentRef.DoesFolderRequireMetadataOrTaxonomy(_folderID, _contentLanguage))
            {
                isMetadataOrTaxonomyRequired = true;
            }

            ExplorerDragDrop dragDrop = new ExplorerDragDrop();

            bool _useSSL = Ektron.Cms.Common.EkFunctions.GetConfigBoolean("ek_UseOffloadingSSL", false);
            string _scheme = string.Empty;
            if (_useSSL)
            {
                _scheme = "https";
            }
            else
            {
                _scheme = Page.Request.Url.Scheme;
            }

            destination.Value = Convert.ToString(_scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + m_refContApi.ApplicationPath) + "processMultiupload.aspx?close=true";
            PostURL.Value = Convert.ToString(_scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + m_refContApi.ApplicationPath) + "processMultiupload.aspx?close=true";
            NextUsing.Value = Convert.ToString(_scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + m_refContApi.ApplicationPath + "content.aspx");
            content_id.Value = "-1";
            content_folder.Value = _folderID.ToString();
            content_language.Value = _contentLanguage.ToString();
            requireMetaTaxonomy.Value = isMetadataOrTaxonomyRequired.ToString();
            taxonomyselectedtree.Value = _taxonomyID.ToString();
            content_teaser.Value = "";
            HtmlGenericControl linebreak = new HtmlGenericControl("div");
            linebreak.InnerHtml += "<div id=\'divFileTypes\' style=\'display:none;float:left;\'> " + m_refMsg.GetMessage("lbl valid file types") + "<p class=\'dmsSupportedFileTypes\' style=\'font-size:11px;\'>" + DocumentManagerData.Instance.FileTypes + "</p></div>";
            linebreak.InnerHtml += "<br />";
            linebreak.InnerHtml += "<div id=idMultipleView style=\'display:inline\'>";
            linebreak.InnerHtml += (string) ("<script type=\"text/javascript\">" + Environment.NewLine);
            linebreak.InnerHtml += (string) (" AC_AX_RunContent(\'id\',\'idUploadCtl\',\'name\',\'idUploadCtl\',\'classid\',\'CLSID:07B06095-5687-4d13-9E32-12B4259C9813\',\'width\',\'100%\',\'height\',\'350px\');" + Environment.NewLine);
            linebreak.InnerHtml += Environment.NewLine + " </script> </div> " + Environment.NewLine;
            linebreak.InnerHtml += "<br /><br />";
            //tabMultipleDMS.Controls.Add(linebreak);
            if (Request.Cookies[DMSCookieName] != null && !string.IsNullOrEmpty(Request.Cookies[DMSCookieName].Value))
            {
                pnl_versionToggle.Visible = pnl_DMSMultiUpload.Visible = true;
                pnl_OfficeVerSelector.Visible = false;

                if (Request.Cookies[DMSCookieName].Value == "2010")
                {
                    ExplorerDragDrop edd = new ExplorerDragDrop();
                    string ekdavurl=edd.GetFolderPath(_folderID).Replace(Page.Request.Url.GetLeftPart(UriPartial.Authority), "");
                    try
                    {
                        string[] urlparts = ekdavurl.Split('_');
                        urlparts[4] = _taxonomyID.ToString();
                        ekdavurl = string.Join("_", urlparts);
                    }
                    catch
                    { }
                    destination.Value = ekdavurl;//edd.GetFolderPath(_folderID).Replace(Page.Request.Url.GetLeftPart(UriPartial.Authority), "");
                    putopts.Value = "false";
                    Upload.OnClientClick = "return MultipleDocumentUpload(0);";
                    lbtn_toggleVersion.Attributes.Add("onclick", string.Format(m_refMsg.GetMessage("js office version toggle confirm format"), m_refMsg.GetMessage("li text office 2010 name")));
                    lbtn_toggleVersion.Text = m_refMsg.GetMessage("lbtn dms switch office version") + "(Office 2010 selected)";
                }
                else
                {
                    destination.Value = _scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + m_refContApi.ApplicationPath + "processMultiupload.aspx?close=true";
                    PostURL.Value = _scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + m_refContApi.ApplicationPath + "processMultiupload.aspx?close=true";
                    putopts.Value = "true";
                    Upload.OnClientClick = "MultipleDocumentUpload(1);";
                    lbtn_toggleVersion.Attributes.Add("onclick", string.Format(m_refMsg.GetMessage("js office version toggle confirm format"), m_refMsg.GetMessage("li text other office ver name")));
                    lbtn_toggleVersion.Text = m_refMsg.GetMessage("lbtn dms switch office version") + "(Office 2003/2007 selected)";

                }
                tabMultipleDMS.Controls.Add(linebreak);
            }
            else
            {
                pnl_versionToggle.Visible = pnl_DMSMultiUpload.Visible = false;
                pnl_OfficeVerSelector.Visible = true;
            }

            if (Request.QueryString["showtab"] != null && Request.QueryString["showtab"] == "multiple")
            {
                ltrNoUpload.Text = m_refMsg.GetMessage("lbl upload file");
                ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "var ddTabs = $ektron('#DMStabs').tabs({select: function(event, ui){ResizeDocumentContainer(ui);}}); ddTabs.tabs('select', 1);", true);
            }

            if (! Page.IsPostBack)
            {

                dragDrop.FolderID = _folderID;
                dragDrop.TaxonomyId = _taxonomyID;

                if (_contentLanguage != -1)
                {
                    dragDrop.ContentLanguage = _contentLanguage;
                }

                HelpMessage.Text = "Fill out the description and then click next to upload image(s)."; //m_refMsg.GetMessage("lbl fill out the description and then click next to drag and drop image(s)")
                btnNext.Text = m_refMsg.GetMessage("next") + ">>";
                ImagegalleryTitleLbl = m_refMsg.GetMessage("generic title label");
                ImagegalleryImageWidthLbl = m_refMsg.GetMessage("lbl maximum width");
                ImagegalleryAddressLbl = m_refMsg.GetMessage("lbl image mapaddress");
                ImagegalleryDescriptionLbl = m_refMsg.GetMessage("description label");
                HeaderLabel.Text = m_refMsg.GetMessage("lbl photo data");
                btnNext.Attributes.Add("onclick", "ResizeContainer();");

                if ((Request.QueryString["prop"] != null)&& Request.QueryString["prop"] != "" && (Request.QueryString["type"] == "update") || (Request.QueryString["prop"] == "image"))
                {
                    // Content Designer
                    ctlEditor.FolderId = _folderID;
                    ctlEditor.AllowFonts = true;

                    if (Request.QueryString["prop"] == "image")
                    {
                        dragDrop.IsImage = 1;
                    }

                    this.panelImageProperties.Visible = true;
                    this.panelDragDrop.Visible = false;
                    if ((Request.QueryString["type"] != null)&& Request.QueryString["type"] == "update")
                    {
                        HelpMessage.Text = m_refMsg.GetMessage("lbl fill out the description and then click save");
                        btnNext.Attributes.Add("onclick", "return HideContainer(this);");
                        long id = 0;
                        if (Request.QueryString["id"] != null)
                        {
                            id = Convert.ToInt64(Request.QueryString["id"]);
                        }
                        ekImagegalleryImageWidthLbl.Visible = false;
                        ekImagegalleryImageWidth.Visible = false;
                        if (id > 0)
                        {
                            Ektron.Cms.ContentData data;
                            Ektron.Cms.ContentAPI api = new Ektron.Cms.ContentAPI();
                            data = api.GetContentById(id, 0);
                            this.ekImagegalleryTitle.Value = Server.HtmlDecode(data.Title);
                            ctlEditor.Content = data.Teaser;
                            if (Request.QueryString["prop"] == "image")
                            {
                                this.HeaderLabel.Text = "Image Properties";
                                foreach (Ektron.Cms.ContentMetaData item in data.MetaData)
                                {
                                    if (item.TypeName.ToLower() == "mapaddress")
                                    {
                                        this.ekImagegalleryAddress.Value = item.Text;
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                this.HeaderLabel.Text = "Document Properties";
                                this.ekImagegalleryAddress.Visible = false;
                                this.ekImagegalleryAddressLbl.Visible = false;
                            }
                            btnNext.Text = "Save";
                        }
                    }
                    else
                    {
                        ekImagegalleryTitleLbl.Visible = false;
                        ekImagegalleryTitle.Visible = false;
                    }
                }
                else
                {
                    this.panelImageProperties.Visible = false;
                    this.panelDragDrop.Visible = true;
                }
            }
            else
            {
                Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();
                string desc = "";
                int width = 800;
                string address = "";
                desc = (string) ctlEditor.Content;
                if (Request.Form["ekImagegalleryImageWidth"] != null)
                {
                    width = System.Convert.ToInt32(Request.Form["ekImagegalleryImageWidth"].ToString());
                }
                if (Request.Form["ekImagegalleryAddress"] != null)
                {
                    address = (string) (Request.Form["ekImagegalleryAddress"].ToString());
                }

                string[] imageProp = new string[4];
                imageProp[0] = width.ToString(); //width
                imageProp[1] = "-1"; //height
                imageProp[2] = address; //mapaddress
                imageProp[3] = desc; //Descriptions

                if (Request.QueryString["type"] != "update")
                {
                    Ektron.ASM.EkDavProtocol.Constants.GetCustomCacheManger().Remove(api.UserId.ToString() + "_" + api.UniqueId.ToString() + "_MapMeta");
                    Ektron.ASM.EkDavProtocol.Constants.GetCustomCacheManger().Add(api.UserId.ToString() + "_" + api.UniqueId.ToString() + "_MapMeta", imageProp);
                }
            }

            if (Request.Browser.Type.IndexOf("Firefox") != -1)
            {
                liDragDrop.Visible = true;
                tabDragDrop.Visible = true;
                tabDragDrop.Controls.Add(dragDrop);
            }

            literal_wait.Text = m_refMsg.GetMessage("one moment msg");
    }
Beispiel #7
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();
            string sitepath = api.SitePath;
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJS);

            SaveButton.OnClientClick = "if(Ektron.RuleEditor.save('" + ruleEditor.UniqueID + "') == false){ return false;}";

            if (PageEditing == TargetedContentViewSet.GetActiveView())
            {
                Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronUICoreJS);
                Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronUISortableJS);
                Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronStringJS);
                Ektron.Cms.API.Css.RegisterCss(this, sitepath + "widgets/TargetedContent/css/TargetedContent.css", "TargetedContentCSS");
                Ektron.Cms.API.JS.RegisterJSInclude(this, sitepath + "widgets/TargetedContent/js/TargetedContent.js", "TargetedContentJS");

                hdnSelectedZone.Value = this.SelectedZone.ToString();
                Ektron.Cms.API.JS.RegisterJSBlock(this, string.Format("Ektron.Widget.TargetedContent.init(\"{0}\", {1})", wrapper.ClientID, _host.GetColumns().Count), "TargetedContentInit" + UniqueID);
            }
            else if (PageEditingGlobalConfig == TargetedContentViewSet.GetActiveView())
            {
                Ektron.Cms.API.Css.RegisterCss(this, sitepath + "widgets/TargetedContent/css/TargetedContent.css", "TargetedContentCSS");
                Ektron.Cms.API.JS.RegisterJSInclude(this, sitepath + "widgets/TargetedContent/js/TargetedContent.js", "TargetedContentJS");
            }
            else if ((Page as Ektron.Cms.PageBuilder.PageBuilder) != null && (Page as Ektron.Cms.PageBuilder.PageBuilder).Status == Ektron.Cms.PageBuilder.Mode.Editing)
            {
                //master layout with edit
                Ektron.Cms.API.Css.RegisterCss(this, sitepath + "widgets/TargetedContent/css/TargetedContent.css", "TargetedContentCSS");
            }
        }
Beispiel #8
0
        protected void Page_Init(object sender, EventArgs e)
        {
            m_refMsg = common.EkMsgRef;
            Ektron.Cms.PageBuilder.PageBuilder pb = this.Page as Ektron.Cms.PageBuilder.PageBuilder;
            if (pb == null)
            {
                TargetedContentViewSet.SetActiveView(NonPageBuilderView);
                return;
            }

            Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();

            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronUICoreJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronUIDialogJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, api.ApplicationPath + "controls/paging/clientpaging/ektron.controls.clientpaging.js", "EktronWorkareaClientPagingJs");

            _host = (Ektron.Cms.PageBuilder.WidgetHost)Ektron.Cms.Widget.WidgetHost.GetHost(this);
            _host.ExpandOptions = Expandable.DontExpand; // Expandable.ExpandOnEdit;
            //string myPath = string.Empty;
            //if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["ek_helpDomainPrefix"]))
            //{
            //    string helpDomain = ConfigurationManager.AppSettings["ek_helpDomainPrefix"];
            //    if ((helpDomain.IndexOf("[ek_cmsversion]") > 1))
            //    {
            //        myPath = helpDomain.Replace("[ek_cmsversion]", new CommonApi().RequestInformationRef.Version.Replace(".", "0").Substring(0, 3));
            //    }
            //    else
            //    {
            //        myPath = ConfigurationManager.AppSettings["ek_helpDomainPrefix"];
            //    }
            //}
            //else
            //{
            //    myPath = api.AppPath + "/help";
            //}
            //_host.HelpFile = myPath + "/Widget Chapter/Targeted Content/Creating Conditions with the Targeted Content Widget.htm";
            _host.Edit += new EditDelegate(host_edit);

            SaveButton.OnClientClick = "if(Ektron.RuleEditor.save('" + ruleEditor.UniqueID + "') == false){ return false;}";

            ruleEditor.Save += new EventHandler<SaveEventArgs>(ruleEditor_Save);

            pb.PageUpdated += new EventHandler(pb_PageUpdated);

            ConditionalZones.DeleteColumn += new EventHandler<ColumnDisplay.DeleteColumnEventArgs>(DeleteConditionalZone);
            ConditionalZones.WidgetHost = _host;
            ActiveColumn.WidgetHost = _host;

            // Localization
            _host.Title = m_refMsg.GetMessage("lbl targeted content");
            btnAddConditionalZone.Text = "<span class=\"ui-icon ui-icon-plus\"></span>" + m_refMsg.GetMessage("lbl new condition");
            btnEditConditionalZone.Text =  m_refMsg.GetMessage("lbl edit condition");
            _conditionNameLabel = m_refMsg.GetMessage("foldername label");
            _defaultConditionName = "{0}";
            CancelButton.Text = CancelButton.ToolTip = m_refMsg.GetMessage("generic cancel");
            SaveButton.Text = SaveButton.ToolTip = m_refMsg.GetMessage("btn save");

            AddAllRuleTemplates();

            //Forced TargetedContent to be loaded.
            if (TargetConfigurationId > 0 && !IsWorkarea)
            {
                TargetedContent = null;
                _host.Edit -= new EditDelegate(host_edit);
            }

            _currentColumns = _host.GetColumns();

            if (Rulesets != null && _targetedContent == null)
            {
                //this is an upgraded version of the widget.
                LoadLegacyWidget();
            }

            LoadTargetConfigurationData();

            if (_host.GetColumns().Count == 0)
            {
                AddConditionalZone();
            }

            //if IsMasterlayoutLocked - show normal page view
            if ((Page as Ektron.Cms.PageBuilder.PageBuilder).Status == Ektron.Cms.PageBuilder.Mode.Editing && !IsMasterLayoutWidgetLocked())
            {
                if (TargetConfigurationId == 0 || IsWorkarea)
                {
                    TargetedContentViewSet.SetActiveView(PageEditing);
                }
                else
                {
                    SetGlobalTargetedContentView();
                }

                this.aSelectGlobalConfig.Attributes.Add("onclick", "Ektron.Widget.TargetedContentList.showDialog('" + ClientID + "');return false;");
                RefreshColumns();
            }
            else
            {
                TargetedContentViewSet.SetActiveView(View);

                //Get all available Widget child columns
                //these are the possible columns to show based upon evaluated conditions
                List<Ektron.Cms.PageBuilder.ColumnData> hostColumns = _host.GetColumns();

                if (hostColumns.Count > 0)
                {
                    ActiveColumn.IsEditable = !IsMasterLayoutWidgetLocked();
                    ActiveColumn.Columns = SelectConditionalZone();
                }
            }
        }
Beispiel #9
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        cContent = m_refContentApi.EkContentRef;
        aAllBoards = (DiscussionBoard[])Array.CreateInstance(typeof(DiscussionBoard), 0);
        bIsAdmin = m_refContentApi.IsAdmin();
        base.Page_Load(sender, e);
        Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();

        if (Request.QueryString["boardid"] != "")
        {
            m_iBoardID = Convert.ToInt64(Request.QueryString["boardid"]);
        }

        if (Convert.ToBoolean(api.RequestInformationRef.IsMembershipUser) || api.RequestInformationRef.UserId == 0)
        {
            Response.Redirect(api.SitePath + "login.aspx", true);
            return;
        }
        else if (!m_refContentApi.IsARoleMemberForFolder_FolderUserAdmin(m_iBoardID, api.RequestInformationRef.UserId, false) && !m_refContentApi.IsAdmin())
        {
            Utilities.ShowError(m_refMsg.GetMessage("com: user does not have permission"));
            return;
        }
        else
        {
            if (!string.IsNullOrEmpty(Request.QueryString["fromboard"]))
            {
                bfromboard = true;
            }

            SetLabels();

            switch (this.m_sPageAction)
            {
                case "edit":
                    if (Page.IsPostBack)
                    {
                        Process_AddEdit();
                    }
                    else
                    {
                        AddEdit();
                    }
                    break;
                case "view":
                    View();
                    break;
                case "delete":
                    Delete();
                    break;
                default: //display
                    Display();
                    break;
            }

            GenerateJS();
        }
    }
Beispiel #10
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Utilities.AddSessionIdField(this.Form);
            _api = new Ektron.Cms.CommonApi();
            _MessageHelper = _api.EkMsgRef;
            if (Request.RawUrl.ToLower().Contains("<script"))
            {
                Utilities.ShowError(_MessageHelper.GetMessage("invalid querstring"));
                return;
            }
            this.RegisterWorkareaCssLink();
            this.RegisterDialogCssLink();

            Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronSmartFormCss);
            Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronSmartFormIe7Css, Css.BrowserTarget.LessThanEqualToIE7);

            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronStringJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronXmlJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronSmartFormJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../ekxbrowser.js", "ekxbrowserJS");
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../ekutil.js", "ekutilJS");
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../RadWindow.js", "RadWindowJS");
            Ektron.Cms.API.JS.RegisterJSInclude(this, "../ekformfields.js", "ekformfieldsJS"); // include after smartForm.js
            Ektron.Cms.API.JS.RegisterJSInclude(this, "choicesfield.js", "choicesfieldJS");
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "InitializeRadWindow", "InitializeRadWindow();", true);

            string sSelected = this.GetMessage("lbl selected");
            string sText = this.GetMessage("lbl text nc");
            string sCannotBeBlank = this.GetMessage("lbl cannot be blank");
            string sValidation = @"design_validate_re(/\S+/,this,'" + sCannotBeBlank + @"');";
            string sValue = this.GetMessage("lbl value");
            string sDisabled = this.GetMessage("lbl disabled");

            this.Title.Text = this.GetMessage("lbl choices field");
            this.RadTabStrip1.Tabs[0].Text = this.GetMessage("tab general");
            this.RadTabStrip1.Tabs[0].ToolTip = this.GetMessage("tab general") + " Tab";
            this.RadTabStrip1.Tabs[1].Text = this.GetMessage("tab validation");
            this.RadTabStrip1.Tabs[1].ToolTip = this.GetMessage("tab validation") + " Tab";
            this.RadTabStrip1.Tabs[2].Text = this.GetMessage("tab data style");
            this.RadTabStrip1.Tabs[2].ToolTip = this.GetMessage("tab data style") + " Tab";
            this.RadTabStrip1.Tabs[3].Text = this.GetMessage("tab advanced");
            this.RadTabStrip1.Tabs[3].ToolTip = this.GetMessage("tab advanced") + " Tab";

            this.lblList.InnerHtml = this.GetMessage("lbl list c");
            this.lblList.Attributes["for"] = this.cboList.ClientID;
            this.lblAllowSelection.InnerHtml = this.GetMessage("lbl allow selection");
            this.lblOnlyOne.InnerHtml = this.GetMessage("lbl only one");
            this.lblMoreThanOne.InnerHtml = this.GetMessage("lbl more than one");
            this.lblSelectionReqd.InnerHtml = this.GetMessage("lbl selection reqd");
            this.lblFirstNotValid.InnerHtml = this.GetMessage("lbl first not valid");
            this.lblAppearance.InnerHtml = this.GetMessage("lbl appearance");
            this.lblVertList.InnerHtml = this.GetMessage("lbl vert list");
            this.lblHorzList.InnerHtml = this.GetMessage("lbl horz list");
            this.lblListBox.InnerHtml = this.GetMessage("lbl list box");
            this.lblDropList.InnerHtml = this.GetMessage("lbl drop list");
            this.lblItemList.InnerHtml = this.GetMessage("lbl item list");
            this.lblSelected.InnerHtml = sSelected;
            this.lblDisplayText.InnerHtml = this.GetMessage("lbl display text");
            this.lblValue.InnerHtml = sValue;
            this.lblDisabled.InnerHtml = sDisabled;
            this.lblOption.Text = this.GetMessage("lbl option");
            this.lblOption2.Text = this.lblOption.Text;

            this.selected.Attributes["title"] = sSelected;
            this.Text.Attributes["title"] = sText;
            this.Text.Attributes["alt"] = sText;
            this.Text.Attributes["onblur"] = sValidation;
            this.Text.Attributes["ektdesignns_invalidmsg"] = sCannotBeBlank;
            this.value.Attributes["title"] = sValue;
            this.value.Attributes["alt"] = sValue;
            this.disabled.Attributes["title"] = sDisabled;

            this.selected1.Attributes["title"] = sSelected;
            this.Text1.Attributes["title"] = sText;
            this.Text1.Attributes["alt"] = sText;
            this.Text1.Attributes["onblur"] = sValidation;
            this.Text1.Attributes["ektdesignns_invalidmsg"] = sCannotBeBlank;
            this.value1.Attributes["title"] = sValue;
            this.value1.Attributes["alt"] = sValue;
            this.disabled1.Attributes["title"] = sDisabled;

            this.sOptionsReqd.Text = this.GetMessage("msg options reqd");
            this.sFirstNotValid.Text = this.GetMessage("msg first not valid");
            this.sCannotBeBlank.Text = sCannotBeBlank;
            this.sFirstRowText.Text = this.GetMessage("lbl first display text on choices option");

            if (!Page.IsPostBack)
            {
                BindComboBox();
            }
        }
Beispiel #11
0
    private void ProcessMenuRequest()
    {
        Ektron.Cms.ContentAPI myContent = new Ektron.Cms.ContentAPI();
        Ektron.Cms.CommonApi AppUI = new Ektron.Cms.CommonApi();
        Ektron.Cms.API.User.User myUser = new Ektron.Cms.API.User.User();

        long contentId = Convert.ToInt64(Request.QueryString["contentId"]);
        int languageId = -1;
        long taxonomyOverrideId = 0;
        if (Request.QueryString["dmsLanguageId"] != null)
        {
            if (Request.QueryString["dmsLanguageId"] != String.Empty)
            {
                languageId = Convert.ToInt32(Request.QueryString["dmsLanguageId"]);
                if (languageId == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || languageId == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                {
                    languageId = AppUI.DefaultContentLanguage;
                }
                AppUI.ContentLanguage = languageId;
                myContent.ContentLanguage = languageId;
            }
        }

        //createIeSpecificMenu is an argument passed to the constructor of the DMSMenuContentAPI class
        //This arg tells DMSMenuContentAPI whether or not to include the IE specific functionality
        //namely, this funcitonality is the office-specific stuff (Edit In Microsoft Office, View in Microsoft Office).
        Boolean createIeSpecificMenu = false;
        if (Request.QueryString["createIeSpecificMenu"] != String.Empty)
        {
            createIeSpecificMenu = Convert.ToBoolean(Request.QueryString["createIeSpecificMenu"]);
        }

        string dmsMenuType = String.Empty;
        string dmsMenuSubtype = String.Empty;
        long communityGroupID = 0;

        if (!String.IsNullOrEmpty(Request.QueryString["communityDocuments"]))
        {
            // Dms community menus may carry additional data (i.e. group id).
            string[] splitDmsMenuTypeInfo = Request.QueryString["communityDocuments"].Split(
                new char[] { '_' },
                StringSplitOptions.RemoveEmptyEntries);

            dmsMenuType = splitDmsMenuTypeInfo[0];

            if (splitDmsMenuTypeInfo.Length == 2)
            {
                long.TryParse(splitDmsMenuTypeInfo[1], out communityGroupID);
            }
        }

        Ektron.Cms.ContentData myContentData = new Ektron.Cms.ContentData();
        Ektron.Cms.API.Content.Content apiCont = new Ektron.Cms.API.Content.Content();
        Ektron.Cms.ContentStateData stateData = apiCont.GetContentState(contentId);
        if (stateData.Status == "A")
            myContentData = apiCont.GetContent(contentId, Ektron.Cms.ContentAPI.ContentResultType.Published);
        else
            myContentData = apiCont.GetContent(contentId, Ektron.Cms.ContentAPI.ContentResultType.Staged);

        string dmsMenuGuid;
        XsltArgumentList myDMSMenuArguments = new XsltArgumentList();
        Ektron.Cms.Workarea.Dms.DmsMenu myDMSMenu;
        if (dmsMenuType != "")
        {
            bool queryDynamicContentBox = false;
            string controlID = String.Empty;

            if (Request.QueryString["dynamicContentBox"] != null)
            {
                queryDynamicContentBox = Convert.ToBoolean(Request.QueryString["DynamicContentBox"]);
                if (dmsMenuType.ToLower() == "communityuser" || dmsMenuType.ToLower() == "communitygroup" && EkConstants.IsAssetContentType(myContentData.ContType, true) && myContentData.ContType !=(int) EkEnumeration.CMSContentType.Multimedia)
                {
                    if (myContentData.AssetData != null && !EkFunctions.IsImage("." + myContentData.AssetData.FileExtension) && myContentData.Type !=(int) EkEnumeration.CMSContentType.Multimedia)
                    {
                        queryDynamicContentBox = false;
                    }
                }

                myDMSMenuArguments.AddParam("dynamicContentBox", String.Empty, queryDynamicContentBox);
            }
            if (Request.QueryString["dmsEktControlID"] != null)
            {
                controlID = Request.QueryString["dmsEktControlID"].ToString();
                myDMSMenuArguments.AddParam("dmsEktControlID", String.Empty, controlID);
            }
            if (Request.QueryString["taxonomyOverrideId"] != null)
            {
                taxonomyOverrideId = Convert.ToInt64(Request.QueryString["taxonomyOverrideId"]);
            }
        }

        if (Request.QueryString["dmsMenuGuid"] != null)
        {
            dmsMenuGuid = Request.QueryString["dmsMenuGuid"].ToString();
            myDMSMenuArguments.AddParam("dmsMenuGuid", String.Empty, dmsMenuGuid);
        }

        Boolean IsPhotoGallery = true;
        if (Request.QueryString["dmsMenuSubtype"] != null)
        {
            dmsMenuSubtype = Request.QueryString["dmsMenuSubtype"].ToString();
            myDMSMenuArguments.AddParam("dmsMenuSubtype", String.Empty, dmsMenuSubtype);
            IsPhotoGallery = (dmsMenuSubtype == "photo");
        }

        string fromPage = String.Empty;
        if (Request.QueryString["fromPage"] != null)
        {
            fromPage = Request.QueryString["fromPage"].ToString();
            myDMSMenuArguments.AddParam("fromPage", String.Empty, fromPage);
        }

        switch (dmsMenuType.ToLower())
        {
            case "taxonomy":
                //Taxonomy Implementation
                //Use Taxnonomy constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, int taxonomyOverrideId)
                if (Request.QueryString["communityGroupid"] != null)
                {
                    long.TryParse(Request.QueryString["communityGroupid"].ToString(), out communityGroupID);
                }
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.Taxonomy,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, taxonomyOverrideId, communityGroupID);
                break;
            case "communityuser":
                //Community User Implementation
                //Use Community User constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, Boolean isPhotoGallery)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.CommunityUser,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, IsPhotoGallery);
                break;
            case "communitygroup":
                //Community Group Implementation
                //Use Community Group constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, int taxonomyOverrideId, int communityGroupId, Boolean isPhotoGallery)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.CommunityGroup,
                    contentId, myUser.UserId, languageId, myContentData.FolderId, myContentData.Type,
                    createIeSpecificMenu, taxonomyOverrideId, communityGroupID, IsPhotoGallery, fromPage);
                break;
            case "favorites":
                //Favorites Menu Implementation
                //Use Favorites constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, int taxonomyOverrideId, int communityGroupId, Boolean isPhotoGallery)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.Favorites,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, taxonomyOverrideId,
                    communityGroupID, IsPhotoGallery, fromPage);
                break;
            case "workarea":
            default:
                //Workarea Implementation
                //Use Workarea constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.Workarea,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, fromPage);
                break;
        }

        DMSMenu.Text = myDMSMenu.GetDmsMenu(myDMSMenuArguments);
    }
Beispiel #12
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = (new CommonApi()).EkMsgRef;
            m_refMsg = m_refSiteApi.EkMsgRef;
            AppImgPath = m_refSiteApi.AppImgPath;
            // get and apply the Content Language value
            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"));
                }
            }
            m_refContentApi.RequestInformationRef.ContentLanguage = ContentLanguage;
            // get the specific Synonym ID
            if (Strings.Trim(Request.QueryString["id"]).Length > 0)
            {
                if (! (Request.QueryString["id"].ToString() == Guid.Empty.ToString()))
                {
                    synonymID = new Guid(Strings.Trim(Request.QueryString["id"]));
                }
                else
                {
                    synonymID = Guid.Empty ;
                }
            }
            else
            {
                synonymID = Guid.Empty;
            }

            Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();
            try
            {
                SynonymData synonymSetData = GetSynonym(synonymID, ContentLanguage);

                ViewToolBar(synonymSetData);
                OutputSynonymSetsForID(synonymSetData);
            }
            catch (Exception ex)
            {
                Utilities.ShowError(ex.Message);
            }
    }
    void _host_Edit(string settings)
    {
        menulist.Items.Clear();
        //get list of menu's
        Ektron.Cms.CommonApi m_refApi = new Ektron.Cms.CommonApi();
        PageRequestData req = new PageRequestData();
        req.PageSize = 500;
        Microsoft.VisualBasic.Collection menu_list = m_refApi.EkContentRef.GetMenuReport("", ref req);
        ListItem li = new ListItem();
        for (int i = 0; i <= menu_list.Count; i++)
        {
            if (i != 0)
            {
                Microsoft.VisualBasic.Collection menuData = (Microsoft.VisualBasic.Collection)menu_list[i];
                li = new ListItem();
                try
                {
                    li.Text = menuData[3].ToString();
                    li.Value = menuData[1].ToString();
                    menulist.Items.Add(li);
                }
                catch
                {
                }
            }
        }
        if (_menuID != 0)
        {
            menulist.SelectedValue = _menuID.ToString();
        }
        vert.Checked = _verticalField;
        cacheinterval.Text = _cacheInterval.ToString();
        displayxslt.Text = _displayXslt;
        language.Text = _Language.ToString();
        stylesheet.Text = _Stylesheet;
        enableajax.Checked = _enableAjax;
        enablesmartopen.Checked = _enablesmartOpen;
        enablemouseoverpopup.Checked = _enablemouseoverPopup;
        startlevel.Text = _startLevel.ToString();
        startcollapsed.Checked = _startCollapsed;
        menudepth.Text = _menuDepth.ToString();

        ViewSet.SetActiveView(Edit);
    }
Beispiel #14
0
    private void Login(string username, string password, string domain)
    {
        //Hashtable user;
        ApplicationAPI appAPI = new ApplicationAPI();

        // if the username and password are both blank, then return
        // whether or not the user is currently logged in, and if he
        // is, return the userid and uniqueid
        if (username == "" && password == "")
        {
            Response.Clear();
            Response.Write("loginCallback(" + (appAPI.IsLoggedIn ? "'userid=" +
                appAPI.UserId + "&uniqueid=" + appAPI.UniqueId + "'" : "'0'") + ");");
            //Response.End();
            return;
        }

        // similarly, if the user is logged in, don't login again!
        if (appAPI.IsLoggedIn)
        {
            Response.Clear();
            Response.Write("loginCallback('userid=" + appAPI.UserId +
                "&uniqueid=" + appAPI.UniqueId + "');");
            //Response.End();
            return;
        }

        // login and create the cookies...
        Ektron.Cms.CommonApi appUI = new Ektron.Cms.CommonApi();

        System.Collections.Hashtable cUser = new Hashtable();

        string serverName = Request.ServerVariables.Get("SERVER_NAME");

        cUser = appUI.EkUserRef.logInUser(username, password, serverName, "", appUI.AuthProtocol, false, EkEnumeration.AutoAddUserTypes.Author);

        if (cUser.Count > 0)
        {
            //Response.Clear();
            HttpCookie cookEcm;

            /*if (!(Request.Cookies.Get("ecm") == null))
            {

                cookEcm = Request.Cookies.Get("ecm");

                cookEcm.Expires = DateTime.Now;

                Response.Cookies.Add(cookEcm);

            }*/

            cookEcm = new HttpCookie("ecm");

            cookEcm.Values.Add("user_id", cUser["UserID"].ToString());

            cookEcm.Values.Add("site_id", appUI.SitePath + "," + cUser["LoginNumber"].ToString());

            cookEcm.Values.Add("userfullname", cUser["UserName"].ToString());

            cookEcm.Values.Add("username", username);

            cookEcm.Values.Add("new_site", appUI.SitePath.ToString());

            cookEcm.Values.Add("unique_id", cUser["LoginNumber"].ToString());

            cookEcm.Values.Add("site_preview", "0");

            cookEcm.Values.Add("langvalue", "");

            System.Configuration.AppSettingsReader objConfigSettings = new System.Configuration.AppSettingsReader();

            string i_mLangId = objConfigSettings.GetValue("ek_DefaultContentLanguage", typeof(string)).ToString();

            cookEcm.Values.Add("DefaultLangauge", i_mLangId);

            cookEcm.Values.Add("NavLanguage", i_mLangId);

            cookEcm.Values.Add("SiteLanguage", i_mLangId);

            cookEcm.Values.Add("LastValidLanguageID", i_mLangId);

            cookEcm.Values.Add("UserCulture", i_mLangId);

            cookEcm.Expires = DateTime.Now.AddYears(1);
            bool encryptCookie = false;
            try
            {
                encryptCookie = Convert.ToBoolean(objConfigSettings.GetValue("ek_EnableCookieEncryption", typeof(bool)));
            }
            catch
            {

            }
            if (encryptCookie)
                Response.Cookies.Add(SecureCookie.Encode(cookEcm));
            else
                Response.Cookies.Add(cookEcm);

            System.Web.HttpCookie cookieEktGUID;

            if (Request.Cookies.Get("EktGUID") == null)
            { //create GUID if it doesn't exist

                string strGUID = System.Guid.NewGuid().ToString();

                cookieEktGUID = new HttpCookie("EktGUID", strGUID);

                cookieEktGUID.Path = "/";

                cookieEktGUID.Expires = DateTime.Now.AddYears(1);

                Response.Cookies.Add(cookieEktGUID);

                Ektron.Cms.UserAPI m_refUserApi = new Ektron.Cms.UserAPI();

                m_refUserApi.RequestInformationRef.ClientEktGUID = strGUID;

            }

            Response.Write("loginCallback('userid=" +
                cUser["UserID"].ToString() + "&uniqueid=" +
                cUser["LoginNumber"].ToString() + "');");
            //Response.End();
        }
        else
        {
            // if login failed, return 0
            Response.Clear();
            Response.Write("loginCallback(0)");
            //Response.End();
        }
    }
Beispiel #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Ektron.Cms.CommonApi capi = new Ektron.Cms.CommonApi();
     Ektron.Cms.API.JS.RegisterJS(this, capi.AppPath + "analytics/template/s_code.js", "Analytics_Template_SiteCatalyst_JS");
     //this.AppPath.Text = capi.AppPath;
 }
Beispiel #16
0
    protected EkContentCol GetAllContent(long nID, long RequestedFolderID, string OrderBy, int currentPage, int pageSize, ref int totalPages, EkEnumeration.CMSContentType ContentType)
    {
        EkContentCol returnValue;
        Collection cCollection = new Collection();
        Collection cTmp = new Collection();
        Collection cTmps = new Collection();
        EkContentCol cAllViewable = new EkContentCol();
        // Dim lLoop As Integer
        bool bIsAllowed = false;
        Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();
        object GetContents = "";

        try
        {
            returnValue = null;

            bIsAllowed = System.Convert.ToBoolean(m_refContent.IsAllowed(RequestedFolderID, 0, "Folder", "Collections", 0)
                || m_refContent.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AminCollectionMenu), api.RequestInformationRef.CallerId, false)
                || m_refContent.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminCollection), api.RequestInformationRef.CallerId, false));
            if (!bIsAllowed)
            {
                throw (new Exception(m_refContentApi.EkMsgRef.GetMessage("com: user does not have permission")));
            }

            string strReturn = "";
            cCollection = m_refContent.pGetEcmCollectionByID(nID, false, false, ref strReturn, EkContent.ContentResultType.Published, GetContents, true, true);
            if (cCollection.Count == 0)
            {
                throw (new Exception(m_refContentApi.EkMsgRef.GetMessage("com: collection not found")));
            }

            cTmp.Add(RequestedFolderID, "FolderID", null, null);
            cTmp.Add(OrderBy, "OrderBy", null, null);
            cTmp.Add(1, "FilterContentAssetType", null, null);
            if (ContentType != Ektron.Cms.Common.EkEnumeration.CMSContentType.AllTypes)
            {
                cTmp.Add(ContentType, "ContentType", null, null);
            }
            //m_refContent.RequestInformation.ContentLanguage = AppUI.ContentLanguage;
            EkEnumeration.CMSContentSubtype subType = (EkEnumeration.CMSContentSubtype)Enum.Parse(typeof(EkEnumeration.CMSContentSubtype), "-1");
            cAllViewable = m_refContent.GetAllViewableChildInfov5_0(cTmp, currentPage, pageSize, ref totalPages, ContentType, subType);
            CollectionContentItems = (Collection)cCollection["Contents"];
            returnValue = cAllViewable;
        }
        catch (Exception)
        {
            return null;
        }
        finally
        {
            cCollection = null;
            cTmp = null;
            cTmps = null;
            cAllViewable = null;
        }

        return returnValue;
    }