Example #1
0
        public static MvcHtmlString SortMenu(this HtmlHelper helper, int siteID, string menuName,
                                             string groupName = "ol", string itemName = "li",
                                             string cssMenu   = "", string cssItem    = "", string itemFormat = "")
        {
            AppMenuModel appMenu = null;

            // Зарежда менюто от базата
            using (AppMenuContext context = new AppMenuContext())
            {
                appMenu = context.GetAppMenu(siteID, menuName);
            }

            // Генерира елементите на менюто
            AppMenuItems items = new AppMenuItems(helper);

            items.AppMenu    = appMenu;
            items.GroupName  = groupName;
            items.ItemName   = itemName;
            items.CSSMenu    = cssMenu;
            items.CSSItem    = cssItem;
            items.IsItemLink = false;
            items.IsItemID   = true;
            items.ItemFormat = itemFormat;

            string menu = items.Generate();

            return(new MvcHtmlString(menu));
        }
Example #2
0
        public static MvcHtmlString AppMenu(this HtmlHelper helper, int siteID
                                            , string menuName, string groupName = "ul", string itemName = "li"
                                            , string cssMenu = "", string cssGroupSelected = "", string cssItemSelected = "")
        {
            AppMenuModel appMenu = null;

            // Зарежда менюто от базата
            using (AppMenuContext context = new AppMenuContext())
            {
                appMenu = context.GetAppMenu(siteID, menuName);
            }

            // Генерира елементите на менюто
            AppMenuItems items = new AppMenuItems(helper);

            items.AppMenu          = appMenu;
            items.GroupName        = groupName;
            items.ItemName         = itemName;
            items.CSSMenu          = cssMenu;
            items.CSSGroupSelected = cssGroupSelected;
            items.CSSItemSelected  = cssItemSelected;

            string menu = items.Generate();

            return(new MvcHtmlString(menu));
        }