Esempio 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);
				}
			}
		}
Esempio 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();
            }
        }
Esempio 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();
			}
		}
Esempio 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);
                }
            }
        }
Esempio 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);
				}
			}
		}