예제 #1
0
 private static void AddChildActions(ModuleAction objParentAction, Node objParentNode, Node objRootNode, IActionControl objActionControl, int intDepth)
 {
     bool blnPending;
     foreach (ModuleAction objAction in objParentAction.Actions)
     {
         blnPending = IsActionPending(objParentNode, objRootNode, intDepth);
         if (objAction.Title == "~")
         {
             if (blnPending == false)
             {
                 objParentNode.Nodes.AddBreak();
             }
         }
         else
         {
             if (objAction.Visible == true && (objAction.Secure != SecurityAccessLevel.Anonymous || ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "EDIT", objActionControl.ModuleControl.ModuleContext.Configuration)) && ModulePermissionController.HasModuleAccess(objAction.Secure, Null.NullString, objActionControl.ModuleControl.ModuleContext.Configuration))
             {
                 if (blnPending)
                 {
                     objParentNode.HasNodes = true;
                 }
                 else
                 {
                     Node objNode;
                     int i = objParentNode.Nodes.Add();
                     objNode = objParentNode.Nodes[i];
                     objNode.ID = objAction.ID.ToString();
                     objNode.Key = objAction.ID.ToString();
                     objNode.Text = objAction.Title;
                     if (!String.IsNullOrEmpty(objAction.ClientScript))
                     {
                         objNode.JSFunction = objAction.ClientScript;
                         objNode.ClickAction = eClickAction.None;
                     }
                     else
                     {
                         objNode.NavigateURL = objAction.Url;
                         if (objAction.UseActionEvent == false && !String.IsNullOrEmpty(objNode.NavigateURL))
                         {
                             objNode.ClickAction = eClickAction.Navigate;
                             if (objAction.NewWindow)
                             {
                                 objNode.Target = "_blank";
                             }
                         }
                         else
                         {
                             objNode.ClickAction = eClickAction.PostBack;
                         }
                     }
                     objNode.Image = objAction.Icon;
                     if (objAction.HasChildren())
                     {
                         AddChildActions(objAction, objNode, objRootNode, objActionControl, intDepth);
                     }
                 }
             }
         }
     }
 }
 public void AddRange(ModuleAction[] value)
 {
     int i;
     for (i = 0; i <= value.Length - 1; i++)
     {
         Add(value[i]);
     }
 }
 public ModuleAction Add(int ID, string Title, string CmdName, string CmdArg, string Icon, string Url, string ClientScript, bool UseActionEvent, SecurityAccessLevel Secure, bool Visible,
 bool NewWindow)
 {
     ModuleAction ModAction = new ModuleAction(ID, Title, CmdName, CmdArg, Icon, Url, ClientScript, UseActionEvent, Secure, Visible,
     NewWindow);
     this.Add(ModAction);
     return ModAction;
 }
 public ModuleActionCollection(ModuleAction[] value)
 {
     AddRange(value);
 }
 public void Remove(ModuleAction value)
 {
     List.Remove(value);
 }
 public void Insert(int index, ModuleAction value)
 {
     List.Insert(index, value);
 }
 public int IndexOf(ModuleAction value)
 {
     return List.IndexOf(value);
 }
 private void AddMenuMoveActions()
 {
     _actions.Add(GetNextActionID(), "~", "", "", "", "", false, SecurityAccessLevel.Anonymous, true, false);
     ModuleAction MoveActionRoot = new ModuleAction(GetNextActionID(), Localization.GetString(ModuleActionType.MoveRoot, Localization.GlobalResourceFile), "", "", "", "", "", false, SecurityAccessLevel.View, true,
     false);
     if (Configuration != null)
     {
         if ((Configuration.ModuleOrder != 0) && (Configuration.PaneModuleIndex > 0))
         {
             MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveTop, Localization.GlobalResourceFile), ModuleActionType.MoveTop, Configuration.PaneName, "action_top.gif", "", false, SecurityAccessLevel.View, true, false);
             MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveUp, Localization.GlobalResourceFile), ModuleActionType.MoveUp, Configuration.PaneName, "action_up.gif", "", false, SecurityAccessLevel.View, true, false);
         }
         if ((Configuration.ModuleOrder != 0) && (Configuration.PaneModuleIndex < (Configuration.PaneModuleCount - 1)))
         {
             MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveDown, Localization.GlobalResourceFile), ModuleActionType.MoveDown, Configuration.PaneName, "action_down.gif", "", false, SecurityAccessLevel.View, true, false);
             MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveBottom, Localization.GlobalResourceFile), ModuleActionType.MoveBottom, Configuration.PaneName, "action_bottom.gif", "", false, SecurityAccessLevel.View, true, false);
         }
     }
     foreach (object obj in PortalSettings.ActiveTab.Panes)
     {
         string pane = obj as string;
         if (!string.IsNullOrEmpty(pane) && !Configuration.PaneName.Equals(pane, StringComparison.InvariantCultureIgnoreCase))
         {
             MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MovePane, Localization.GlobalResourceFile) + " " + pane, ModuleActionType.MovePane, pane, "action_move.gif", "", false, SecurityAccessLevel.View, true, false);
         }
     }
     if (MoveActionRoot.Actions.Count > 0)
     {
         _actions.Add(MoveActionRoot);
     }
 }
예제 #9
0
 public static Node GetActionNode(string strID, string strNamespace, ModuleAction objActionRoot, Control objControl)
 {
     NodeCollection objNodes = GetActionNodes(objActionRoot, objControl, -1);
     Node objNode = objNodes.FindNode(strID);
     NodeCollection objReturnNodes = new NodeCollection(strNamespace);
     objReturnNodes.Import(objNode);
     objReturnNodes[0].ID = strID;
     return objReturnNodes[0];
 }
 private void AddHelpActions()
 {
     ModuleAction helpAction = new ModuleAction(GetNextActionID());
     helpAction.Title = Localization.GetString(ModuleActionType.ModuleHelp, Localization.GlobalResourceFile);
     helpAction.CommandName = ModuleActionType.ModuleHelp;
     helpAction.CommandArgument = "";
     helpAction.Icon = "action_help.gif";
     helpAction.Url = Globals.NavigateURL(TabId, "Help", "ctlid=" + Configuration.ModuleControlId.ToString(), "moduleid=" + ModuleId);
     helpAction.Secure = SecurityAccessLevel.Edit;
     helpAction.Visible = true;
     helpAction.NewWindow = false;
     helpAction.UseActionEvent = true;
     _actions.Add(helpAction);
     string helpURL = Globals.GetOnLineHelp(Configuration.ModuleControl.HelpURL, Configuration);
     if (!string.IsNullOrEmpty(helpURL))
     {
         helpAction = new ModuleAction(GetNextActionID());
         helpAction.Title = Localization.GetString(ModuleActionType.OnlineHelp, Localization.GlobalResourceFile);
         helpAction.CommandName = ModuleActionType.OnlineHelp;
         helpAction.CommandArgument = "";
         helpAction.Icon = "action_help.gif";
         helpAction.Url = Globals.FormatHelpUrl(helpURL, PortalSettings, Configuration.DesktopModule.FriendlyName);
         helpAction.Secure = SecurityAccessLevel.Edit;
         helpAction.UseActionEvent = true;
         helpAction.Visible = true;
         helpAction.NewWindow = true;
         _actions.Add(helpAction);
     }
 }
예제 #11
0
 private static void AddChildActions(ModuleAction objParentAction, Node objParentNode, IActionControl objActionControl)
 {
     AddChildActions(objParentAction, objParentNode, objParentNode, objActionControl, -1);
 }
예제 #12
0
 public static NodeCollection GetActionNodes(ModuleAction objActionRoot, Node objRootNode, Control objControl, int intDepth)
 {
     NodeCollection objCol = objRootNode.ParentNode.Nodes;
     IActionControl objActionControl = objControl as IActionControl;
     if (objActionControl != null)
     {
         AddChildActions(objActionRoot, objRootNode, objRootNode, objActionControl, intDepth);
     }
     return objCol;
 }
예제 #13
0
 public static NodeCollection GetActionNodes(ModuleAction objActionRoot, Control objControl, int intDepth)
 {
     NodeCollection objCol = new NodeCollection(objControl.ClientID);
     IActionControl objActionControl = objControl as IActionControl;
     if (objActionControl != null)
     {
         if (objActionRoot.Visible)
         {
             objCol.Add();
             Node objRoot = objCol[0];
             objRoot.ID = objActionRoot.ID.ToString();
             objRoot.Key = objActionRoot.ID.ToString();
             objRoot.Text = objActionRoot.Title;
             objRoot.NavigateURL = objActionRoot.Url;
             objRoot.Image = objActionRoot.Icon;
             objRoot.Enabled = false;
             AddChildActions(objActionRoot, objRoot, objRoot.ParentNode, objActionControl, intDepth);
         }
     }
     return objCol;
 }
예제 #14
0
 public static NodeCollection GetActionNodes(ModuleAction objActionRoot, Control objControl)
 {
     return GetActionNodes(objActionRoot, objControl, -1);
 }
 public int Add(ModuleAction value)
 {
     return List.Add(value);
 }
 private void AddPrintAction()
 {
     ModuleAction action = new ModuleAction(GetNextActionID());
     action.Title = Localization.GetString(ModuleActionType.PrintModule, Localization.GlobalResourceFile);
     action.CommandName = ModuleActionType.PrintModule;
     action.CommandArgument = "";
     action.Icon = "action_print.gif";
     action.Url = Globals.NavigateURL(TabId, "", "mid=" + ModuleId.ToString(), "SkinSrc=" + Globals.QueryStringEncode("[G]" + SkinController.RootSkin + "/" + Globals.glbHostSkinFolder + "/" + "No Skin"), "ContainerSrc=" + Globals.QueryStringEncode("[G]" + SkinController.RootContainer + "/" + Globals.glbHostSkinFolder + "/" + "No Container"), "dnnprintmode=true");
     action.Secure = SecurityAccessLevel.Anonymous;
     action.UseActionEvent = true;
     action.Visible = true;
     action.NewWindow = true;
     _actions.Add(action);
 }
 private void AddSyndicateAction()
 {
     ModuleAction action = new ModuleAction(GetNextActionID());
     action.Title = Localization.GetString(ModuleActionType.SyndicateModule, Localization.GlobalResourceFile);
     action.CommandName = ModuleActionType.SyndicateModule;
     action.CommandArgument = "";
     action.Icon = "action_rss.gif";
     action.Url = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "moduleid=" + ModuleId.ToString()).Replace(Globals.glbDefaultPage, "RSS.aspx");
     action.Secure = SecurityAccessLevel.Anonymous;
     action.UseActionEvent = true;
     action.Visible = true;
     action.NewWindow = true;
     _actions.Add(action);
 }
 public bool Contains(ModuleAction value)
 {
     return this.Contains(value);
 }
 public ActionEventArgs(ModuleAction Action, ModuleInfo ModuleConfiguration)
 {
     _action = Action;
     _moduleConfiguration = ModuleConfiguration;
 }