Exemplo n.º 1
0
 /// <summary>
 /// Gets a value indicating that the specified action is setup page.
 /// </summary>
 /// <param name="action">The action to check.</param>
 /// <returns>true, if the specified action is setup page; otherwise, false.</returns>
 internal static bool IsSetupPage(ConfigurationDataSet.ActionRow action)
 {
     if ((ActionType)action.ActionTypeId == ActionType.Page)
     {
         if ((action.ActionId == SetupPageActionId) || (action.ActionId == SetupGlobalNavigationLinkActionId))
         {
             return(true);
         }
         else if (!action.IsNavigateUrlNull())
         {
             return(ResourceProvider.IsSetupPageUrl(action.NavigateUrl));
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        internal static Action CreateAction(ConfigurationDataSet.ActionRow row)
        {
            if (row != null)
            {
                Action action = new Action();
                action.ActionId                    = row.ActionId;
                action.ParentActionId              = (row.IsParentActionIdNull() ? null : new Guid?(row.ParentActionId));
                action.ActionType                  = (ActionType)row.ActionTypeId;
                action.Name                        = row.Name;
                action.Description                 = row.Description;
                action.IconUrl                     = row.IconUrl;
                action.SubmenuItemImageUrl         = row.SubmenuItemImageUrl;
                action.SubmenuItemType             = (SubmenuItemType)row.SubmenuItemTypeId;
                action.SubmenuItemHorizontalAlign  = (HorizontalAlign)row.SubmenuItemHorizontalAlignId;
                action.SubmenuItemWidth            = row.SubmenuItemWidth;
                action.HighlightInSubmenu          = row.HighlightInSubmenu;
                action.NavigateUrl                 = (row.IsNavigateUrlNull() ? null : row.NavigateUrl);
                action.LearnMoreUrl                = row.LearnMoreUrl;
                action.VideoUrl                    = row.VideoUrl;
                action.OrderNumber                 = row.OrderNumber;
                action.AuthenticationRequired      = row.AuthenticationRequired;
                action.OrganizationRequired        = row.OrganizationRequired;
                action.InstanceRequired            = row.InstanceRequired;
                action.Visible                     = row.Visible;
                action.ShowInDetailMenu            = row.ShowInDetailMenu;
                action.ShowChildrenInDetailMenu    = row.ShowChildrenInDetailMenu;
                action.ShowDescriptionInDetailMenu = row.ShowDescriptionInDetailMenu;
                action.GroupInDetailMenu           = row.GroupInDetailMenu;
                action.HighlightInDetailMenu       = row.HighlightInDetailMenu;
                if (!row.IsDetailMenuThemeNull())
                {
                    action.DetailMenuTheme = (DetailMenuTheme)row.DetailMenuTheme;
                }
                if (!row.IsDetailMenuIconSizeNull())
                {
                    action.IconSize = (IconSize)row.DetailMenuIconSize;
                }
                action.BuiltIn = row.BuiltIn;
                action.Handle  = row.Handle;

                if (action.ActionId == LoginGlobalNavigationLinkActionId)
                {
                    action.NavigateUrl = LoginProvider.Current.GetLoginUrl(false);
                }
                else if (action.ActionId == MyAccountGlobalNavigationLinkActionId)
                {
                    if (FrameworkConfiguration.Current.WebApplication.MasterPage.Theme != Micajah.Common.Pages.MasterPageTheme.Modern)
                    {
                        action.OrderNumber = -action.OrderNumber;
                    }
                }

                foreach (ConfigurationDataSet.ActionsParentActionsRow alternativeParentActionRow in row.GetActionsParentActionsRowsByFK_Mc_ActionsParentActions_Mc_Action_2())
                {
                    action.AlternativeParentActions.Add(alternativeParentActionRow.ParentActionId);
                }

                return(action);
            }
            return(null);
        }