Ejemplo n.º 1
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Adds the contents of another <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleActionCollection" />
 ///  to the end of the collection.
 /// </summary>
 /// <param name="value">A <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleActionCollection" /> containing
 /// the objects to add to the collection. </param>
 /// -----------------------------------------------------------------------------
 public void AddRange(ModuleActionCollection value)
 {
     foreach (ModuleAction mA in value)
     {
         this.Add(mA);
     }
 }
Ejemplo n.º 2
0
 ///-----------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:DotNetNuke.ModuleAction"/> class
 /// using the specified parameters
 /// </summary>
 /// <param name="id">This is the identifier to use for this action.</param>
 /// <param name="title">This is the title that will be displayed for this action</param>
 /// <param name="cmdName">The command name passed to the client when this action is
 /// clicked.</param>
 /// <param name="cmdArg">The command argument passed to the client when this action is
 /// clicked.</param>
 /// <param name="icon">The URL of the Icon to place next to this action</param>
 /// <param name="url">The destination URL to redirect the client browser when this action is clicked.</param>
 /// <param name="clientScript"></param>
 /// <param name="useActionEvent">Determines whether client will receive an event notification</param>
 /// <param name="secure">The security access level required for access to this action</param>
 /// <param name="visible">Whether this action will be displayed</param>
 /// <param name="newWindow"></param>
 /// <remarks>The moduleaction constructor is used to set the various properties of
 /// the <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleAction" /> class at the time the instance is created.
 /// </remarks>
 /// <history>
 ///     [Joe]           10/26/2003	Created
 ///     [Nik Kalyani]	10/15/2004	Created multiple signatures to eliminate Optional parameters
 /// </history>
 ///-----------------------------------------------------------------------------
 public ModuleAction(int id, string title, string cmdName, string cmdArg, string icon, string url, string clientScript, bool useActionEvent, SecurityAccessLevel secure, bool visible,
                     bool newWindow)
 {
     ID              = id;
     Title           = title;
     CommandName     = cmdName;
     CommandArgument = cmdArg;
     Icon            = icon;
     Url             = url;
     ClientScript    = clientScript;
     UseActionEvent  = useActionEvent;
     Secure          = secure;
     Visible         = visible;
     NewWindow       = newWindow;
     Actions         = new ModuleActionCollection();
 }
Ejemplo n.º 3
0
        public ModuleActionCollection GetActionsByCommandName(string name)
        {
            var retActions = new ModuleActionCollection();

            //Check each action in the List
            foreach (ModuleAction modAction in List)
            {
                if (modAction.CommandName == name)
                {
                    retActions.Add(modAction);
                }
                //If action has children check them
                if (modAction.HasChildren())
                {
                    retActions.AddRange(modAction.Actions.GetActionsByCommandName(name));
                }
            }
            return(retActions);
        }
Ejemplo n.º 4
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="ModuleActionCollection"/>
 ///  class containing the elements of the specified source collection.
 /// </summary>
 /// <param name="value">A <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleActionCollection" /> with which to initialize the collection.</param>
 /// <remarks>This overloaded constructor copies the <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleAction" />s
 ///  from the indicated collection.</remarks>
 /// -----------------------------------------------------------------------------
 public ModuleActionCollection(ModuleActionCollection value)
 {
     this.AddRange(value);
 }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LoadActions loads the Actions collections
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]    01/19/2006  created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void LoadActions(HttpRequest request)
        {
            _actions = new ModuleActionCollection();
            _moduleGenericActions = new ModuleAction(GetNextActionID(), Localization.GetString("ModuleGenericActions.Action", Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty);
            int maxActionId = Null.NullInteger;

            //check if module Implements Entities.Modules.IActionable interface
            var actionable = _moduleControl as IActionable;
            if (actionable != null)
            {
                _moduleSpecificActions = new ModuleAction(GetNextActionID(), Localization.GetString("ModuleSpecificActions.Action", Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty);

                ModuleActionCollection moduleActions = actionable.ModuleActions;

                foreach (ModuleAction action in moduleActions)
                {
                    if (ModulePermissionController.HasModuleAccess(action.Secure, "CONTENT", Configuration))
                    {
                        if (String.IsNullOrEmpty(action.Icon))
                        {
                            action.Icon = "edit.gif";
                        }
                        if (action.ID > maxActionId)
                        {
                            maxActionId = action.ID;
                        }
                        _moduleSpecificActions.Actions.Add(action);

                        if (!UIUtilities.IsLegacyUI(ModuleId, action.ControlKey, PortalId) && action.Url.Contains("ctl"))
                        {
                            action.ClientScript = UrlUtils.PopUpUrl(action.Url, _moduleControl as Control, PortalSettings, true, false);
                        }
                    }
                }
                if (_moduleSpecificActions.Actions.Count > 0)
                {
                    _actions.Add(_moduleSpecificActions);
                }
            }

            //Make sure the Next Action Id counter is correct
            int actionCount = GetActionsCount(_actions.Count, _actions);
            if (_nextActionId < maxActionId)
            {
                _nextActionId = maxActionId;
            }
            if (_nextActionId < actionCount)
            {
                _nextActionId = actionCount;
            }

            //Custom injection of Module Settings when shared as ViewOnly
            if (Configuration != null && (Configuration.IsShared && Configuration.IsShareableViewOnly)
                    && TabPermissionController.CanAddContentToPage())
            {
                _moduleGenericActions.Actions.Add(GetNextActionID(),
                             Localization.GetString("ModulePermissions.Action", Localization.GlobalResourceFile),
                             "ModulePermissions",
                             "",
                             "action_settings.gif",
                             NavigateUrl(TabId, "ModulePermissions", false, "ModuleId=" + ModuleId, "ReturnURL=" + FilterUrl(request)),
                             false,
                             SecurityAccessLevel.ViewPermissions,
                             true,
                             false);
            }
            else
            {
                if (!Globals.IsAdminControl() && ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE,MANAGE", Configuration))
                {
                    if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration))
                    {
                        _moduleGenericActions.Actions.Add(GetNextActionID(),
                                                          Localization.GetString(ModuleActionType.ModuleSettings, Localization.GlobalResourceFile),
                                                          ModuleActionType.ModuleSettings,
                                                          "",
                                                          "action_settings.gif",
                                                          NavigateUrl(TabId, "Module", false, "ModuleId=" + ModuleId, "ReturnURL=" + FilterUrl(request)),
                                                          false,
                                                          SecurityAccessLevel.Edit,
                                                          true,
                                                          false);
                    }
                }
            }

            if (!string.IsNullOrEmpty(Configuration.DesktopModule.BusinessControllerClass))
            {
                //check if module implements IPortable interface, and user has Admin permissions
                if (Configuration.DesktopModule.IsPortable)
                {
                    if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "EXPORT", Configuration))
                    {
                        _moduleGenericActions.Actions.Add(GetNextActionID(),
                                     Localization.GetString(ModuleActionType.ExportModule, Localization.GlobalResourceFile),
                                     "",
                                     "",
                                     "action_export.gif",
                                     NavigateUrl(PortalSettings.ActiveTab.TabID, "ExportModule", false, "moduleid=" + ModuleId, "ReturnURL=" + FilterUrl(request)),

                                     "",
                                     false,
                                     SecurityAccessLevel.View,
                                     true,
                                     false);
                    }
                    if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "IMPORT", Configuration))
                    {
                        _moduleGenericActions.Actions.Add(GetNextActionID(),
                                     Localization.GetString(ModuleActionType.ImportModule, Localization.GlobalResourceFile),
                                     "",
                                     "",
                                     "action_import.gif",
                                     NavigateUrl(PortalSettings.ActiveTab.TabID, "ImportModule", false, "moduleid=" + ModuleId, "ReturnURL=" + FilterUrl(request)),
                                     "",
                                     false,
                                     SecurityAccessLevel.View,
                                     true,
                                     false);
                    }
                }
                if (Configuration.DesktopModule.IsSearchable && Configuration.DisplaySyndicate)
                {
                    AddSyndicateAction();
                }
            }

            //help module actions available to content editors and administrators
            const string permisisonList = "CONTENT,DELETE,EDIT,EXPORT,IMPORT,MANAGE";
            if (ModulePermissionController.HasModulePermission(Configuration.ModulePermissions, permisisonList) && request.QueryString["ctl"] != "Help")
            {
                AddHelpActions();
            }

            //Add Print Action
            if (Configuration.DisplayPrint)
            {
                //print module action available to everyone
                AddPrintAction();
            }
            if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Host, "MANAGE", Configuration))
            {
                _moduleGenericActions.Actions.Add(GetNextActionID(),
                             Localization.GetString(ModuleActionType.ViewSource, Localization.GlobalResourceFile),
                             ModuleActionType.ViewSource,
                             "",
                             "action_source.gif",
                             NavigateUrl(TabId, "ViewSource", false, "ModuleId=" + ModuleId, "ctlid=" + Configuration.ModuleControlId, "ReturnURL=" + FilterUrl(request)),
                             false,
                             SecurityAccessLevel.Host,
                             true,
                             false);
            }



            if (!Globals.IsAdminControl() && ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE,MANAGE", Configuration))
            {
                if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE", Configuration))
                {
                    //Check if this is the owner instance of a shared module.
                    string confirmText = "confirm('" + ClientAPI.GetSafeJSString(Localization.GetString("DeleteModule.Confirm")) + "')";
                    if (!Configuration.IsShared)
                    {
                        var moduleController = new ModuleController();
                        if (moduleController.GetModuleTabs(Configuration.ModuleID).Cast<ModuleInfo>().Any(instance => instance.IsShared))
                        {
                            confirmText = "confirm('" + ClientAPI.GetSafeJSString(Localization.GetString("DeleteSharedModule.Confirm")) + "')";
                        }
                    }

                    _moduleGenericActions.Actions.Add(GetNextActionID(),
                                 Localization.GetString(ModuleActionType.DeleteModule, Localization.GlobalResourceFile),
                                 ModuleActionType.DeleteModule,
                                 Configuration.ModuleID.ToString(),
                                 "action_delete.gif",
                                 "",
                                 confirmText,
                                 false,
                                 SecurityAccessLevel.View,
                                 true,
                                 false);
                }
                if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration))
                {
                    _moduleGenericActions.Actions.Add(GetNextActionID(),
                                 Localization.GetString(ModuleActionType.ClearCache, Localization.GlobalResourceFile),
                                 ModuleActionType.ClearCache,
                                 Configuration.ModuleID.ToString(),
                                 "action_refresh.gif",
                                 "",
                                 false,
                                 SecurityAccessLevel.View,
                                 true,
                                 false);
                }

                if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration))
                {
                    //module movement
                    AddMenuMoveActions();
                }
            }

            if (_moduleGenericActions.Actions.Count > 0)
            {
                _actions.Add(_moduleGenericActions);
            }

            if (_moduleMoveActions != null && _moduleMoveActions.Actions.Count > 0)
            {
                _actions.Add(_moduleMoveActions);
            }

            foreach (ModuleAction action in _moduleGenericActions.Actions)
            {
                if (!UIUtilities.IsLegacyUI(ModuleId, action.ControlKey, PortalId) && action.Url.Contains("ctl"))
                {
                    action.ClientScript = UrlUtils.PopUpUrl(action.Url, _moduleControl as Control, PortalSettings, true, false);
                }
            }
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// GetActionsCount gets the current number of actions
        /// </summary>
        /// <param name="actions">The actions collection to count.</param>
        /// <param name="count">The current count</param>
        /// <history>
        ///     [cnurse]    01/04/2008  Documented
        /// </history>
        /// -----------------------------------------------------------------------------
        private static int GetActionsCount(int count, ModuleActionCollection actions)
        {
            foreach (ModuleAction action in actions)
            {
                if (action.HasChildren())
                {
                    count += action.Actions.Count;

                    //Recursively call to see if this collection has any child actions that would affect the count
                    count = GetActionsCount(count, action.Actions);
                }
            }
            return count;
        }
 ///-----------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleActionCollection" />
 ///  class containing the elements of the specified source collection.
 /// </summary>
 /// <param name="value">A <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleActionCollection" /> with which to initialize the collection.</param>
 /// <remarks>This overloaded constructor copies the <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleAction" />s
 ///  from the indicated collection.</remarks>
 /// <history>
 /// 	[Joe] 	10/9/2003	Created
 /// </history>
 ///-----------------------------------------------------------------------------
 public ModuleActionCollection(ModuleActionCollection value)
 {
     AddRange(value);
 }
 ///-----------------------------------------------------------------------------
 /// <summary>
 /// Adds the contents of another <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleActionCollection" />
 ///  to the end of the collection.
 /// </summary>
 /// <param name="value">A <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleActionCollection" /> containing 
 /// the objects to add to the collection. </param>
 /// <history>
 /// 	[Joe] 	10/9/2003	Created
 /// </history>
 ///-----------------------------------------------------------------------------
 public void AddRange(ModuleActionCollection value)
 {
     foreach (ModuleAction mA in value)
     {
         Add(mA);
     }
 }
        public ModuleActionCollection GetActionsByCommandName(string name)
        {
            var retActions = new ModuleActionCollection();

            //Check each action in the List
            foreach (ModuleAction modAction in List)
            {
                if (modAction.CommandName == name)
                {
                    retActions.Add(modAction);
                }
                //If action has children check them
                if (modAction.HasChildren())
                {
                    retActions.AddRange(modAction.Actions.GetActionsByCommandName(name));
                }
            }
            return retActions;
        }
Ejemplo n.º 10
0
        private void InitModuleActions()
        {
            _moduleActions = new ModuleActionCollection();
            var actions = _moduleActions;
            var appIsKnown = (SxcI.AppId.HasValue);

            if (appIsKnown)
            {
                // Edit item
                if (!SxcI.Template?.UseForList ?? false)
                    actions.Add(GetNextActionID(), LocalizeString("ActionEdit.Text"), "", "", "edit.gif",
                        "javascript:$2sxcActionMenuMapper(" + ModuleId + ").edit();", "test", true,
                        SecurityAccessLevel.Edit, true, false);

                // Add Item
                if (SxcI.Template?.UseForList ?? false)
                    actions.Add(GetNextActionID(), LocalizeString("ActionAdd.Text"), "", "", "add.gif",
                        "javascript:$2sxcActionMenuMapper(" + ModuleId + ").addItem();", true, SecurityAccessLevel.Edit, true,
                        false);

                // Change layout button
                actions.Add(GetNextActionID(), LocalizeString("ActionChangeLayoutOrContent.Text"), "", "", "action_settings.gif",
                    "javascript:$2sxcActionMenuMapper(" + ModuleId + ").changeLayoutOrContent();", false,
                    SecurityAccessLevel.Edit, true, false);
            }

            if (!SecurityHelpers.SexyContentDesignersGroupConfigured(PortalId) ||
                SecurityHelpers.IsInSexyContentDesignersGroup(UserInfo))
            {
                // Edit Template Button
                if (appIsKnown && SxcI.Template != null)
                    actions.Add(GetNextActionID(), LocalizeString("ActionEditTemplateFile.Text"), ModuleActionType.EditContent,
                        "templatehelp", "edit.gif", "javascript:$2sxcActionMenuMapper(" + ModuleId + ").develop();", "test",
                        true,
                        SecurityAccessLevel.Edit, true, false);

                // App management
                if (appIsKnown)
                    actions.Add(GetNextActionID(), "Admin" + (SxcI.IsContentApp ? "" : " " + SxcI.App.Name), "",
                        "", "edit.gif", "javascript:$2sxcActionMenuMapper(" + ModuleId + ").adminApp();", "", true,
                        SecurityAccessLevel.Admin, true, false);

                // Zone management (app list)
                if (!SxcI.IsContentApp)
                    actions.Add(GetNextActionID(), "Apps Management", "AppManagement.Action", "", "action_settings.gif",
                        "javascript:$2sxcActionMenuMapper(" + ModuleId + ").adminZone();", "", true,
                        SecurityAccessLevel.Admin, true, false);
            }
        }
        /// <summary>
        /// LoadActions loads the Actions collections
        /// </summary>
        /// <remarks>
        /// </remarks>
        private void LoadActions()
        {

            _actions = new ModuleActionCollection();
            int maxActionId = Null.NullInteger;

            //check if module Implements Entities.Modules.IActionable interface
            if (this is IActionable)
            {
                // load module actions
                ModuleActionCollection ModuleActions = ((IActionable)this).ModuleActions;

                foreach (ModuleAction action in ModuleActions)
                {
                    if (CanAddAction(action.Secure, false))
                    {
                        if (action.Icon == "")
                        {
                            action.Icon = "edit.gif";
                        }
                        if (action.ID > maxActionId)
                        {
                            maxActionId = action.ID;
                        }
                        _actions.Add(action);
                    }
                }
            }

            //Make sure the Next Action Id counter is correct
            int actionCount = GetActionsCount(_actions.Count, _actions);
            if (_nextActionId < maxActionId)
            {
                _nextActionId = maxActionId;
            }
            if (_nextActionId < actionCount)
            {
                _nextActionId = actionCount;
            }

            if (! (string.IsNullOrEmpty(ModuleConfiguration.BusinessControllerClass)))
            {
                // check if module implements IPortable interface, and user has Admin permissions
                if (ModuleConfiguration.IsPortable & CanAddAction(SecurityAccessLevel.Admin, true))
                {
                    _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ImportModule, Localization.GlobalResourceFile), "", "", "rt.gif", Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportModule", "moduleid=" + ModuleId), "", false, SecurityAccessLevel.Admin, EditMode, false);
                    _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ExportModule, Localization.GlobalResourceFile), "", "", "lt.gif", Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportModule", "moduleid=" + ModuleId), "", false, SecurityAccessLevel.Admin, EditMode, false);
                }

                //If TypeOf objPortalModuleBase Is ISearchable Then
                if (ModuleConfiguration.IsSearchable & CanAddAction(SecurityAccessLevel.Anonymous, true))
                {
                    _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.SyndicateModule, Localization.GlobalResourceFile), ModuleActionType.SyndicateModule, "", "xml.gif", Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "moduleid=" + ModuleId).Replace(Globals.glbDefaultPage, "RSS.aspx"), "", false, SecurityAccessLevel.Anonymous, true, true);
                }
            }

            // help module actions available to content editors and administrators
            if (ModuleConfiguration.ControlType != SecurityAccessLevel.Anonymous & Request.QueryString["ctl"] != "Help")
            {
                SetHelpVisibility();
            }

            //Add Print Action
            if (ModuleConfiguration.DisplayPrint & CanAddAction(SecurityAccessLevel.Anonymous, true))
            {
                // print module action available to everyone
                _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.PrintModule, Localization.GlobalResourceFile), ModuleActionType.PrintModule, "", "print.gif", Globals.NavigateURL(TabId, "", "mid=" + ModuleId, "SkinSrc=" + Globals.QueryStringEncode("[G]" + SkinInfo.RootSkin + "/" + Globals.glbHostSkinFolder + "/" + "No Skin"), "ContainerSrc=" + Globals.QueryStringEncode("[G]" + SkinInfo.RootContainer + "/" + Globals.glbHostSkinFolder + "/" + "No Container"), "dnnprintmode=true"), "", false, SecurityAccessLevel.Anonymous, true, true);
            }

            // core module actions only available to administrators 
            if (CanAddAction(SecurityAccessLevel.Admin, true))
            {
                // module settings
                _actions.Add(GetNextActionID(), "~", "");
                _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ModuleSettings, Localization.GlobalResourceFile), ModuleActionType.ModuleSettings, "", "settings.gif", Globals.NavigateURL(TabId, "Module", "ModuleId=" + ModuleId), false, SecurityAccessLevel.Admin, true);
                _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.DeleteModule, Localization.GlobalResourceFile), ModuleActionType.DeleteModule, ModuleConfiguration.ModuleID.ToString(), "delete.gif", "", "confirm('" + ClientAPI.GetSafeJSString(Localization.GetString("DeleteModule.Confirm")) + "')", false, SecurityAccessLevel.Admin, true, false);
                if (ModuleConfiguration.CacheTime != 0)
                {
                    _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ClearCache, Localization.GlobalResourceFile), ModuleActionType.ClearCache, ModuleConfiguration.ModuleID.ToString(), "restore.gif","",false, SecurityAccessLevel.Admin, true);
                }

                // module movement
                _actions.Add(GetNextActionID(), "~", "");
                ModuleAction MoveActionRoot = new ModuleAction(GetNextActionID(), Localization.GetString(ModuleActionType.MoveRoot, Localization.GlobalResourceFile), "", "", "", "", "", false, SecurityAccessLevel.Admin, EditMode);

                // move module up/down
                if (ModuleConfiguration != null)
                {
                    SetMoveMenuVisibility(MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveTop, Localization.GlobalResourceFile), ModuleActionType.MoveTop, ModuleConfiguration.PaneName, "top.gif","", false, SecurityAccessLevel.Admin, EditMode));
                    SetMoveMenuVisibility(MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveUp, Localization.GlobalResourceFile), ModuleActionType.MoveUp, ModuleConfiguration.PaneName, "up.gif", "",false,SecurityAccessLevel.Admin, EditMode));
                    SetMoveMenuVisibility(MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveDown, Localization.GlobalResourceFile), ModuleActionType.MoveDown, ModuleConfiguration.PaneName, "dn.gif","",false, SecurityAccessLevel.Admin, EditMode));
                    SetMoveMenuVisibility(MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MoveBottom, Localization.GlobalResourceFile), ModuleActionType.MoveBottom, ModuleConfiguration.PaneName, "bottom.gif","",false, SecurityAccessLevel.Admin, EditMode));
                }

                // move module to pane
                for (int intItem = 0; intItem < PortalSettings.ActiveTab.Panes.Count; intItem++)
                {
                    SetMoveMenuVisibility(MoveActionRoot.Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.MovePane, Localization.GlobalResourceFile) + " " + Convert.ToString(PortalSettings.ActiveTab.Panes[intItem]), ModuleActionType.MovePane, Convert.ToString(PortalSettings.ActiveTab.Panes[intItem]), "move.gif", "",false,SecurityAccessLevel.Admin, EditMode));
                }
                foreach (ModuleAction ma in MoveActionRoot.Actions)
                {
                    if (ma.Visible)
                    {
                        _actions.Add(MoveActionRoot);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 12
0
 ///-----------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:DotNetNuke.ModuleAction"/> class
 /// using the specified parameters
 /// </summary>
 /// <param name="id">This is the identifier to use for this action.</param>
 /// <param name="title">This is the title that will be displayed for this action</param>
 /// <param name="cmdName">The command name passed to the client when this action is 
 /// clicked.</param>
 /// <param name="cmdArg">The command argument passed to the client when this action is 
 /// clicked.</param>
 /// <param name="icon">The URL of the Icon to place next to this action</param>
 /// <param name="url">The destination URL to redirect the client browser when this action is clicked.</param>
 /// <param name="clientScript"></param>
 /// <param name="useActionEvent">Determines whether client will receive an event notification</param>
 /// <param name="secure">The security access level required for access to this action</param>
 /// <param name="visible">Whether this action will be displayed</param>
 /// <param name="newWindow"></param>
 /// <remarks>The moduleaction constructor is used to set the various properties of 
 /// the <see cref="T:DotNetNuke.Entities.Modules.Actions.ModuleAction" /> class at the time the instance is created.
 /// </remarks>
 /// <history>
 /// 	[Joe] 	        10/26/2003	Created
 /// 	[Nik Kalyani]	10/15/2004	Created multiple signatures to eliminate Optional parameters
 /// </history>
 ///-----------------------------------------------------------------------------
 public ModuleAction(int id, string title, string cmdName, string cmdArg, string icon, string url, string clientScript, bool useActionEvent, SecurityAccessLevel secure, bool visible,
                     bool newWindow)
 {
     ID = id;
     Title = title;
     CommandName = cmdName;
     CommandArgument = cmdArg;
     Icon = icon;
     Url = url;
     ClientScript = clientScript;
     UseActionEvent = useActionEvent;
     Secure = secure;
     Visible = visible;
     NewWindow = newWindow;
     Actions = new ModuleActionCollection();
 }
 /// <Summary>
 /// Adds the contents of another to the end of the collection.
 /// </Summary>
 /// <Param name="value">
 /// A  containing the objects to add to the collection.
 /// </Param>
 public void AddRange( ModuleActionCollection value )
 {
     foreach( ModuleAction moduleAction in value )
     {
         this.Add( moduleAction );
     }
 }
        public ModuleActionCollection GetIndexActions()
        {
            var actions = new ModuleActionCollection
            {
                new ModuleAction(-1)
                {
                    CommandName = ModuleActionType.AddContent,
                    CommandArgument = String.Empty,
                    Icon = String.Empty,
                    Title = LocalizeString("AddMessage"),
                    Url = ModuleContext.EditUrl("Edit"),
                    Secure = SecurityAccessLevel.Edit,
                    UseActionEvent = false,
                    Visible = true,
                    NewWindow = false
                },
                new ModuleAction(-1)
                {
                    CommandName = ModuleActionType.ContentOptions,
                    CommandArgument = String.Empty,
                    Icon = String.Empty,
                    Title = LocalizeString("AdminList"),
                    Url = ModuleContext.EditUrl("AdminList"),
                    Secure = SecurityAccessLevel.Edit,
                    UseActionEvent = false,
                    Visible = true,
                    NewWindow = false
                },
                new ModuleAction(-1)
                {
                    CommandName = ModuleActionType.ContentOptions,
                    CommandArgument = String.Empty,
                    Icon = String.Empty,
                    Title = LocalizeString("ResetDailyMessage"),
                    Url = ModuleContext.EditUrl("ResetDailyMessage"),
                    //Url = DotNetNuke.Common.Globals.NavigateURL(ModuleContext.TabId,string.Empty,"removeLog=true"),//ModuleContext.EditUrl("ResetDailyMessage"),
                    Secure = SecurityAccessLevel.Edit,
                    UseActionEvent = false,
                    Visible = true,
                    NewWindow = false
                }
            };

            return actions;
        }