Ejemplo n.º 1
0
		protected override void OnPreRender(EventArgs e)
		{
			using (new DNNContext(this))
			{
				try
				{
					base.OnPreRender(e);

					var menuStyle = GetStringSetting("MenuStyle");
					if (String.IsNullOrEmpty(menuStyle))
					{
						menu = null;
						return;
					}

					var menuSettings = new Settings
					                   {
					                   	MenuStyle = GetStringSetting("MenuStyle"),
					                   	NodeXmlPath = GetStringSetting("NodeXmlPath"),
					                   	NodeSelector = GetStringSetting("NodeSelector"),
					                   	IncludeContext = GetBoolSetting("IncludeContext"),
										IncludeHidden = GetBoolSetting("IncludeHidden"),
										IncludeNodes = GetStringSetting("IncludeNodes"),
					                   	ExcludeNodes = GetStringSetting("ExcludeNodes"),
					                   	NodeManipulator = GetStringSetting("NodeManipulator"),
					                   	TemplateArguments =
					                   		DDRMenu.Settings.TemplateArgumentsFromSettingString(GetStringSetting("TemplateArguments")),
					                   	ClientOptions =
					                   		DDRMenu.Settings.ClientOptionsFromSettingString(GetStringSetting("ClientOptions"))
					                   };

					MenuNode rootNode = null;
					if (String.IsNullOrEmpty(menuSettings.NodeXmlPath))
					{
						rootNode =
							new MenuNode(
								Localiser.LocaliseDNNNodeCollection(
									Navigation.GetNavigationNodes(
										ClientID,
										Navigation.ToolTipSource.None,
										-1,
										-1,
										DNNAbstract.GetNavNodeOptions(menuSettings.IncludeHidden))));
					}

					menu = MenuBase.Instantiate(menuStyle);
					menu.RootNode = rootNode;
					menu.ApplySettings(menuSettings);

					menu.PreRender();
				}
				catch (Exception exc)
				{
					Exceptions.ProcessModuleLoadException(this, exc);
				}
			}
		}
Ejemplo n.º 2
0
        protected override void OnPreRender(EventArgs e)
        {
            using (new DNNContext(this))
            {
                base.OnPreRender(e);

                MenuSettings.MenuStyle = MenuSettings.MenuStyle ?? "DNNMenu";
                menu                  = MenuBase.Instantiate(MenuSettings.MenuStyle);
                menu.RootNode         = RootNode ?? new MenuNode();
                menu.SkipLocalisation = SkipLocalisation;
                menu.ApplySettings(MenuSettings);

                menu.PreRender();
            }
        }
Ejemplo n.º 3
0
		protected override void OnPreRender(EventArgs e)
		{
			using (new DNNContext(this))
			{
				base.OnPreRender(e);

				MenuSettings.MenuStyle = MenuSettings.MenuStyle ?? "DNNMenu";
				menu = MenuBase.Instantiate(MenuSettings.MenuStyle);
				menu.RootNode = RootNode ?? new MenuNode();
				menu.SkipLocalisation = SkipLocalisation;
				menu.ApplySettings(MenuSettings);

				menu.PreRender();
			}
		}
Ejemplo n.º 4
0
        protected override void OnPreRender(EventArgs e)
        {
            using (new DNNContext(this))
            {
                try
                {
                    base.OnPreRender(e);

                    menu = MenuBase.Instantiate(MenuStyle);
                    menu.ApplySettings(
                        new Settings
                    {
                        MenuStyle         = MenuStyle,
                        NodeXmlPath       = NodeXmlPath,
                        NodeSelector      = NodeSelector,
                        IncludeContext    = IncludeContext,
                        IncludeHidden     = IncludeHidden,
                        IncludeNodes      = IncludeNodes,
                        ExcludeNodes      = ExcludeNodes,
                        NodeManipulator   = NodeManipulator,
                        ClientOptions     = ClientOptions,
                        TemplateArguments = TemplateArguments
                    });

                    if (String.IsNullOrEmpty(NodeXmlPath))
                    {
                        menu.RootNode =
                            new MenuNode(
                                Localiser.LocaliseDNNNodeCollection(
                                    Navigation.GetNavigationNodes(
                                        ClientID,
                                        Navigation.ToolTipSource.None,
                                        -1,
                                        -1,
                                        DNNAbstract.GetNavNodeOptions(true))));
                    }

                    menu.PreRender();
                }
                catch (Exception exc)
                {
                    Exceptions.ProcessModuleLoadException(this, exc);
                }
            }
        }
Ejemplo n.º 5
0
		protected override void OnPreRender(EventArgs e)
		{
			using (new DNNContext(this))
			{
				try
				{
					base.OnPreRender(e);

					menu = MenuBase.Instantiate(MenuStyle);
					menu.ApplySettings(
						new Settings
						{
							MenuStyle = MenuStyle,
							NodeXmlPath = NodeXmlPath,
							NodeSelector = NodeSelector,
							IncludeContext = IncludeContext,
							IncludeHidden = IncludeHidden,
							IncludeNodes = IncludeNodes,
							ExcludeNodes = ExcludeNodes,
							NodeManipulator = NodeManipulator,
							ClientOptions = ClientOptions,
							TemplateArguments = TemplateArguments
						});

					if (String.IsNullOrEmpty(NodeXmlPath))
					{
						menu.RootNode =
							new MenuNode(
								Localiser.LocaliseDNNNodeCollection(
									Navigation.GetNavigationNodes(
										ClientID,
										Navigation.ToolTipSource.None,
										-1,
										-1,
										DNNAbstract.GetNavNodeOptions(IncludeHidden))));
					}

					menu.PreRender();
				}
				catch (Exception exc)
				{
					Exceptions.ProcessModuleLoadException(this, exc);
				}
			}
		}