Ejemplo n.º 1
0
    private void PopulateContentGridData(AxMenuData menu)
    {
        if (m_strPageAction == "removeitems")
        {
            MenuItemList.Columns.Add(m_refstyle.CreateBoundField("CHECK", "<input type=\"Checkbox\" name=\"checkall\" onclick=\"checkAll(\'frm_content_ids\',false);\">", "title-header", HorizontalAlign.Center, HorizontalAlign.Center, Unit.Percentage(2), Unit.Percentage(2), false, false));
        }
        MenuItemList.Columns.Add(m_refstyle.CreateBoundField("TITLE", m_refMsg.GetMessage("generic title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(30), Unit.Percentage(50), false, false));
        MenuItemList.Columns.Add(m_refstyle.CreateBoundField("LANGUAGE", m_refMsg.GetMessage("generic language"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
        MenuItemList.Columns.Add(m_refstyle.CreateBoundField("ID", m_refMsg.GetMessage("generic id"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
        MenuItemList.Columns.Add(m_refstyle.CreateBoundField("URL", m_refMsg.GetMessage("generic url link"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(20), false, false));
        DataTable dt = new DataTable();
        DataRow dr;
        if (m_strPageAction == "removeitems")
        {
            dt.Columns.Add(new DataColumn("CHECK", typeof(string)));
        }
        dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
        dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string)));
        dt.Columns.Add(new DataColumn("ID", typeof(string)));
        dt.Columns.Add(new DataColumn("URL", typeof(string)));
        //If (m_strViewItem <> "folder") Then
        PageSettings();
        //If (menu_item_data.Count > 0) Then
        if (menu.Item.Length > 0)
        {
            AddDeleteIcon = true;
            string icon = "";
            string title = "";
            string link = "";
            string backPage = EkFunctions.UrlEncode(Request.Url.ToString());
            //For Each item As AxMenuItemData In menu_item_data
            foreach (AxMenuItemData item in menu.Item)
            {
                if (item == null)
                {
                    continue;
                }

                if ((Convert.ToInt32(item.ItemType) == 4) && (m_strPageAction == "removeitems"))
                {
                    // submenus need to be deleted individually so they shouldn't show up in this list!
                    continue;
                }

                MenuItemCount++;
                dr = dt.NewRow();
                if (m_strPageAction == "removeitems")
                {
                    dr["CHECK"] = "<input type=\"checkbox\" id=\"frm_content_ids\" name=\"frm_content_ids\" value=\"" + item.ID + "\" onclick=\"checkAll(\'frm_content_ids\',true);\">";
                }

                //backPage = EkFunctions.UrlEncode("Action=viewcontent&view=item&menuid=" & MenuId)
                //link = "<a href='content.aspx?action=View&LangType=" & item.ContentLanguage & "&id=" & item.ID & "&callerpage=menu.aspx&origurl=" & backPage & "' title='" & title & "'>" & item.ItemTitle & "</a>"

                title = (string)(m_refMsg.GetMessage("generic View") + " \"" + item.ItemTitle.Replace(" \'", "`") + "\"");
                string editmenuitemurl;
                editmenuitemurl = (string)("collections.aspx?action=EditMenuItem&nid=" + MenuId + "&id=" + item.ID + "&Ty=" + item.ItemType + "&back=" + backPage);
                link = "<a href=\'" + editmenuitemurl + " \'>" + item.ItemTitle + "</a>";

                Collection iteminfo = null;

                string assetimageurl = "";

                if ((Convert.ToInt32(item.ItemType) == 1))
                {
                    if (item.ItemSubType == 8)
                    {
                        iteminfo = m_refContentApi.EkContentRef.GetMenuItemByID(item.ItemID, item.ID, false);
                        // this is a DMS asset so we have to look up the icon for it because the menu api doesn't have this
                        Ektron.Cms.ContentData assetcontentdata = m_refContent.GetContentById(Convert.ToInt64(iteminfo["ItemID"]), Ektron.Cms.Content.EkContent.ContentResultType.Published);
                        AssetManagement.AssetManagementService service = new AssetManagement.AssetManagementService();
                        Ektron.ASM.AssetConfig.AssetFileInformation fileInfo = service.GetFileInformation(assetcontentdata.AssetData.Version);
                        assetimageurl = fileInfo.ImageUrl;
                        icon = "<img src=\"" + fileInfo.ImageUrl + "\" />&nbsp;";
                    }
                    else
                    {
                        icon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/contentHtml.png" + "\" />&nbsp;";
                    }
                }
                else if ((Convert.ToInt32(item.ItemType) == 2))
                {
                    icon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/contentForm.png" + "\" />&nbsp;";
                }
                else if ((Convert.ToInt32(item.ItemType) == 4))
                {
                    icon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/menu.png" + "\" />&nbsp;";
                    link = "<a href=\'menu.aspx?Action=viewcontent&menuid=" + item.ID + "&treeViewId=-3" + "\'>" + item.ItemTitle + "</a>";
                }
                else if ((Convert.ToInt32(item.ItemType) == 5))
                {
                    icon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/link.png" + "\" />&nbsp;";
                }

                if ((Convert.ToInt32(item.ItemType) == 1) || (Convert.ToInt32(item.ItemType) == 2))
                {
                    if (iteminfo == null)
                    {
                        iteminfo = m_refContentApi.EkContentRef.GetMenuItemByID(item.ItemID, item.ID, false);
                    }

                    int itemtype = (int)item.ItemType;
                    if (itemtype == 2)
                    {
                        //For Library Items , ItemID key is a libraryId instead of ContentID and ItemType has to be passed.
                        // this is contenttype 7 for the menu generator.
                        itemtype = 7;
                        dr["TITLE"] = m_refContentApi.GetDmsContextMenuHTML(Convert.ToInt64(iteminfo["ContentID"]), Convert.ToInt64(iteminfo["ContentLanguage"]), itemtype, item.ItemContentSubType, item.ItemTitle, (string)(m_refMsg.GetMessage("edit menu items title") + " " + item.ItemTitle), editmenuitemurl, "", assetimageurl);
                    }
                    else
                    {
                        dr["TITLE"] = m_refContentApi.GetDmsContextMenuHTML(Convert.ToInt64(iteminfo["ItemID"]), Convert.ToInt64(iteminfo["ContentLanguage"]), Convert.ToInt64(iteminfo["ContentType"]), item.ItemContentSubType, item.ItemTitle, (string)(m_refMsg.GetMessage("edit menu items title") + " " + item.ItemTitle), editmenuitemurl, "", assetimageurl);
                    }
                    if ((Convert.ToInt32(item.ItemType) == 1) && (Convert.ToInt32(item.ItemSubType) == 8) && (string.IsNullOrEmpty(iteminfo["ItemLink"].ToString())))
                    {
                        //Using the contentblock control to get the exact quicklink for asset which is not in contendata used above.
                        //This is because the  contentdata or assetdata has nothing to show difference btw assets and privateassets.
                        //Regarding the defect #54892
                        Ektron.Cms.Controls.ContentBlock cBlock = new Ektron.Cms.Controls.ContentBlock();
                        cBlock.Page = this.Page;
                        cBlock.DefaultContentID = Convert.ToInt64(iteminfo["ItemID"]);
                        cBlock.Fill();
                        dr["URL"] = cBlock.EkItem.QuickLink;
                    }
                    else
                    {
                        dr["URL"] = iteminfo["ItemLink"];
                    }
                }
                else
                {
                    dr["TITLE"] = icon + link;
                    dr["URL"] = item.ItemLink;
                }
                dr["ID"] = item.ID;
                dr["LANGUAGE"] = item.ContentLanguage;
                dt.Rows.Add(dr);
            }
        }
        DataView dv = new DataView(dt);
        MenuItemList.DataSource = dv;
        MenuItemList.DataBind();
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef);
        StyleHelper m_refStyle = new StyleHelper();
        CommonApi m_refApi = new CommonApi();
        ApplicationAPI AppUI = new ApplicationAPI();
        sitePath = AppUI.SitePath;
        AppPath = AppUI.AppPath;
        AxMenuData menuData = new AxMenuData();
        string ErrorString ="";
        MenuId = Convert.ToInt64(Request.QueryString["nid"]);
        FolderId = Convert.ToInt64(Request.QueryString["folderid"]);
        if (Request.QueryString["LangType"] == "-1")
        {
            ContentLanguage = AppUI.DefaultContentLanguage;
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            AppUI.ContentLanguage = ContentLanguage;
        }
        else
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            if (ContentLanguage == 0)
            {
                ContentLanguage = AppUI.DefaultContentLanguage;
                AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                AppUI.ContentLanguage = ContentLanguage;
            }
        }
        Hashtable cPerms = AppUI.EkSiteRef.GetPermissions(FolderId, 0, "folder");
        if (!(IsCollectionMenuRoleMember() || (cPerms.Contains("Collections") && Convert.ToBoolean(cPerms["Collections"]))))
            ErrorString = MsgHelper.GetMessage("com: user does not have permission");

        if (ErrorString == "")
        {
            if (m_refApi.TreeModel == 1)
                gtLinks = AppUI.EkContentRef.GetMenuByID(MenuId, 0,false);
            else
                gtLinks = AppUI.EkContentRef.GetMenuByID(MenuId, 0, true);
            menuData = AppUI.EkContentRef.GetMenuDataByID(MenuId);
            if (!string.IsNullOrEmpty(menuData.AssociatedFolderIdList))
            {
                AssociatedFolderIdListString = menuData.AssociatedFolderIdList;
                AssociatedFolderTitleListString = GetTitlesFromFolderIds(menuData.AssociatedFolderIdList);
            }
            if (!string.IsNullOrEmpty(menuData.AssociatedTemplates))
                AssociatedTemplatesString = menuData.AssociatedTemplates;
        }
        litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("edit menu title"));
        litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("editmenu", "") + "</td>";

        if (Request.QueryString["back"] != "")
            litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
        else if (Request.QueryString["iframe"] == "true")
            litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true);
        else
        {
            if (m_refApi.TreeModel == 1)
                litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
            else
                litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenu&nid=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
        }

        litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", "Save Menu", MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'menu\', \'VerifyMenuForm()\');\"", StyleHelper.SaveButtonCssClass, true);

        LanguageName = gtLinks["ContentLanguage"].ToString();
    }
Ejemplo n.º 3
0
    private void MenuToolBar(AxMenuData menu)
    {
        string strDeleteMsg = "";

        strDeleteMsg = m_refMsg.GetMessage("alt delete button text (menu)");
        m_strDelConfirm = m_refMsg.GetMessage("delete menu confirm");
        m_strDelItemsConfirm = m_refMsg.GetMessage("delete menu items confirm");
        m_strSelDelWarning = m_refMsg.GetMessage("select menu item missing warning");

        if (m_strMenuName != null && m_strMenuName.Length > 50)
        {
            m_strMenuName = m_strMenuName.ToString().Remove(50) + " ....";
        }
        divTitleBar.InnerHtml = m_refstyle.GetTitleBar((string)(m_refMsg.GetMessage("view menu title") + " \"" + m_strMenuName + "\"" + "&nbsp;&nbsp;<img style=\'vertical-align:middle;\' src=\'" + objLocalizationApi.GetFlagUrlByLanguageID(MenuLanguage) + "\' />"));
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        result.Append("<table><tr>" + "\r\n");
        string backPage = EkFunctions.UrlEncode(Request.Url.ToString());

        long ParentMenuId = menu.ParentID;
        long FolderID = menu.FolderID;

        if (m_strPageAction != "viewcontent")
        {
            result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", (string)("menu.aspx?action=viewcontent&view=item&menuid=" + MenuId), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }

        if (m_strPageAction != "removeitems")
        {
            // folder ID is 0 here to start the selection of content items at root!
            result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/add.png", (string)("collections.aspx?action=AddMenuItem&nid=" + MenuId + "&folderid=" + FolderID + "&back=" + backPage + "&parentid=" + MenuId + "&ancestorid=" + m_AncestorMenuId), m_refMsg.GetMessage("add collection items"), m_refMsg.GetMessage("add collection items"), "", StyleHelper.AddButtonCssClass, true));
            if (MenuItemCount > 0)
            {
                result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/remove.png", (string)("menu.aspx?action=removeitems&menuid=" + MenuId + "&parentid=" + ParentId), m_refMsg.GetMessage("remove menu items"), m_refMsg.GetMessage("remove menu items"), "", StyleHelper.RemoveButtonCssClass));
            }
            if (MenuItemCount > 1)
            {
                string treeViewIdParam = "";
                if (!string.IsNullOrEmpty(Request.QueryString["treeViewId"]))
                    treeViewIdParam = "&treeViewId=" + Request.QueryString["treeViewId"].ToString();
                result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/arrowUpDown.png", (string)("collections.aspx?action=ReOrderMenuItems&nid=" + MenuId + "&folderid=" + ParentId + treeViewIdParam + "&back=" + backPage), m_refMsg.GetMessage("reorder menu title"), m_refMsg.GetMessage("alt: update menu order text"), "", StyleHelper.ReOrderButtonCssClass));
            }
            //result.Append(m_refstyle.GetButtonEventsWCaption(AppPath & "images/UI/Icons/contentEdit.png", "collections.aspx?action=EditMenu&nid=" & MenuId & "&folderid=" & ParentId & "&back=" & backPage _
            //                                                 , m_refMsg.GetMessage("edit menu title"), m_refMsg.GetMessage("edit menu title"), ""))
            string langParm = ((MenuLanguage > 0) ? "&LangType=" + MenuLanguage : "");
            result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/properties.png", (string)("menu.aspx?action=viewmenu&menuid=" + MenuId + "&parentid=" + ParentId + langParm), m_refMsg.GetMessage("alt menu properties button text"), m_refMsg.GetMessage("properties text"), "", StyleHelper.ViewPropertiesButtonCssClass));
            result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/delete.png", "#", m_refMsg.GetMessage("generic delete title"), m_refMsg.GetMessage("alt delete menu"), "onclick=\"return DeleteItem();\"", StyleHelper.DeleteButtonCssClass));
        }
        else
        {
            if (AddDeleteIcon)
            {
                // deletes checked/selected menu items
                divTitleBar.InnerHtml = m_refstyle.GetTitleBar((string)(m_refMsg.GetMessage("remove items from menu") + " \"" + m_strMenuName + "\"" + "&nbsp;&nbsp;<img style=\'vertical-align:middle;\' src=\'" + objLocalizationApi.GetFlagUrlByLanguageID(MenuLanguage) + "\' />"));
                result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/remove.png", "#", m_refMsg.GetMessage("alt remove button text (taxonomyitems)"), m_refMsg.GetMessage("btn remove"), "onclick=\"return DeleteItem(\'items\');\"", StyleHelper.RemoveButtonCssClass, true));
            }
        }

        string backpagelang = Server.UrlDecode(backPage);
        if (!backPage.Contains("LangType"))
        {
            backpagelang = backpagelang + "&LangType=" + MenuLanguage;
        }
        string addDD;
        if (menu.ParentID == 0)
        {
            addDD = ViewLangsForMenuID(MenuId, "", false, false, "javascript:addBaseMenu(" + MenuId + ", " + ParentMenuId + ", " + m_AncestorMenuId + ", " + FolderID + ", this.value, \'" + backpagelang + "\');");
            if (addDD != "")
            {
                addDD = (string)("&nbsp;" + m_refMsg.GetMessage("generic add title") + ":&nbsp;" + addDD);
            }
            if (m_refContentApi.EnableMultilingual == 1)
            {
                result.Append(StyleHelper.ActionBarDivider);

                result.Append("<td nowrap=\"true\">");
                result.Append("" + m_refMsg.GetMessage("generic view") + ":&nbsp;" + ViewLangsForMenuID(MenuId, "", true, false, "javascript:LoadLanguage(this.value);") + "&nbsp;" + addDD + "<br>");
                result.Append("</td>");
            }
        }

        result.Append(StyleHelper.ActionBarDivider);
        if (m_strPageAction != "removeitems")
            result.Append("<td>" + m_refstyle.GetHelpButton("ViewMenu", "") + "</td>");
        else
            result.Append("<td>" + m_refstyle.GetHelpButton("RemoveMenuItem", "") + "</td>");
        result.Append("</tr></table>");
        divToolBar.InnerHtml = result.ToString();
        result = null;
    }
Ejemplo n.º 4
0
    private void MenuToolBar(AxMenuData menu)
    {
        string strDeleteMsg = "";

            strDeleteMsg = m_refMsg.GetMessage("alt delete button text (menu)");
            m_strDelConfirm = m_refMsg.GetMessage("delete menu confirm");
            m_strDelItemsConfirm = m_refMsg.GetMessage("delete menu items confirm");
            m_strSelDelWarning = m_refMsg.GetMessage("select menu item missing warning");

            divTitleBar.InnerHtml = m_refstyle.GetTitleBar((string) (m_refMsg.GetMessage("view menu title") + " \"" + m_strMenuName + "\"" + "&nbsp;&nbsp;<img style=\'vertical-align:middle;\' src=\'" + objLocalizationApi.GetFlagUrlByLanguageID(MenuLanguage) + "\' />"));
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            result.Append("<table><tr>" + "\r\n");
            string backPage = EkFunctions.UrlEncode(Request.Url.ToString());

            string langParm = ((MenuLanguage > 0) ? "&LangType=" + MenuLanguage : "");

            if (m_strPageAction != "viewcontent")
            {
                result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", (string)("menu.aspx?action=viewcontent&view=item&menuid=" + MenuId), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
            }

            result.Append(m_refstyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/contentEdit.png", (string)("collections.aspx?action=EditMenu&nid=" + MenuId + "&folderid=" + menu.FolderID + langParm + "&back=" + backPage), m_refMsg.GetMessage("edit menu title"), m_refMsg.GetMessage("edit menu title"), "", StyleHelper.EditButtonCssClass, true));

            long ParentMenuId = menu.ParentID;
            long AncestorMenuId = menu.AncestorID;
            long FolderID = menu.FolderID;
            result.Append(StyleHelper.ActionBarDivider);
            result.Append("<td>" + m_refstyle.GetHelpButton("ViewMenu", "") + "</td>");
            result.Append("</tr></table>");
            divToolBar.InnerHtml = result.ToString();
            result = null;
    }
Ejemplo n.º 5
0
    private List<AxMenuData> GetSubmenuList(long id)
    {
        AxMenuData item = m_refApi.EkContentRef.GetMenuDataByID(id);
        List<AxMenuData> menuList = new List<AxMenuData>();
        AxMenuData menuData;
        foreach (AxMenuItemData subitem in item.Item)
        {
            if (subitem != null && subitem.ItemType == Ektron.Cms.Common.EkEnumeration.CMSMenuItemType.Submenu)
            {
                menuData = new AxMenuData();
                menuData.ID = subitem.ID;
                menuData.FolderID = subitem.FolderID;
                menuData.Title = subitem.ItemTitle;
                menuData.Description = "";
                AxMenuData submenuMenus = m_refApi.EkContentRef.GetMenuDataByID(subitem.ID);
                menuData.HasChildren = false;
                foreach (AxMenuItemData submenuMenu in submenuMenus.Item)
                {
                    if (submenuMenu != null && submenuMenu.ItemType == Ektron.Cms.Common.EkEnumeration.CMSMenuItemType.Submenu)
                    {
                        menuData.HasChildren = true;

                    }
                }

                menuData.ContentLanguage = subitem.ContentLanguage;
                menuData.ParentID = m_refApi.EkContentRef.GetParentIdByFolderId(subitem.FolderID);
                menuData.AncestorID = subitem.AncestorID;
                menuData.ItemCount = 1;
                menuData.Type = Ektron.Cms.Common.EkEnumeration.CMSMenuItemType.Menu;
                menuList.Add(menuData);
            }
        }

        return menuList;
    }
Ejemplo n.º 6
0
    private List<AxMenuData> GetMenuList(Collection menus)
    {
        List<AxMenuData> menuList = new List<AxMenuData>();
        AxMenuData menuData;
        //for (int i = 1; i <= menus.Count; i++)
        foreach (Collection temp_varMenus in menus)
        {
            menuData = new AxMenuData();
            menuData.ID = Convert.ToInt64(temp_varMenus["MenuId"]);
            menuData.FolderID = Convert.ToInt64(temp_varMenus["FolderId"]);
            menuData.Title = (string)(temp_varMenus["MenuTitle"]);
            menuData.Description = (string)(temp_varMenus["MenuDescription"]);
            menuData.HasChildren = System.Convert.ToBoolean(temp_varMenus["HasChildren"]);
            menuData.ContentLanguage = Convert.ToInt64(temp_varMenus["ContentLanguage"]);
            menuData.ParentID = Convert.ToInt64(temp_varMenus["ParentID"]);
            menuData.ItemCount = Convert.ToInt64(temp_varMenus["ItemCount"]);
            menuData.AncestorID = Convert.ToInt64(temp_varMenus["AncestorID"]);
            menuData.Type = Ektron.Cms.Common.EkEnumeration.CMSMenuItemType.Menu;
            menuList.Add(menuData);
        }

        return menuList;
    }
Ejemplo n.º 7
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        m_refContentApi = new ContentAPI();
        m_refMsg = m_refContentApi.EkMsgRef;
        AppName = m_refContentApi.AppName;
        AppImgPath = m_refContentApi.AppImgPath;
        StyleSheetJS.Value = m_refStyle.GetClientScript();
        nId = Convert.ToInt64(Request.Params["nid"]);
        menu = m_refContentApi.EkContentRef.GetMenuDataByID(nId);
        ParentMenuId = menu.ParentID;
        AncestorMenuId = menu.AncestorID;
        FolderID = menu.FolderID;
        EnableMultilingual = m_refContentApi.EnableMultilingual;
        if (!Utilities.ValidateUserLogin())
        {
            return;
        }
        if (Convert.ToBoolean(m_refContentApi.RequestInformationRef.IsMembershipUser))
        {
            Response.Redirect((string)("reterror.aspx?info=" + m_refMsg.GetMessage("msg login cms user")), false);
            return;
        }
        RegisterResources();
        if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
        }
        else
        {
            if (!string.IsNullOrEmpty(m_refContentApi.GetCookieValue("LastValidLanguageID")))
            {
                ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
            }
        }

        m_selectedFolderList = GetFolderList(nId);
        MenuToolBar();
    }