Пример #1
0
 public void AddRange(ModuleActionCollection value)
 {
     foreach (ModuleAction mA in value)
     {
         Add(mA);
     }
 }
 public void AddRange(ModuleActionCollection value)
 {
     foreach (ModuleAction mA in value)
     {
         Add(mA);
     }
 }
Пример #3
0
        public ModuleActionCollection GetActionsByCommandName(string name)
        {
            ModuleActionCollection retActions = new ModuleActionCollection();

            foreach (ModuleAction modAction in List)
            {
                if (modAction.CommandName == name)
                {
                    retActions.Add(modAction);
                }
                if (modAction.HasChildren())
                {
                    retActions.AddRange(modAction.Actions.GetActionsByCommandName(name));
                }
            }
            return(retActions);
        }
 public ModuleActionCollection GetActionsByCommandName(string name)
 {
     ModuleActionCollection retActions = new ModuleActionCollection();
     foreach (ModuleAction modAction in List)
     {
         if (modAction.CommandName == name)
         {
             retActions.Add(modAction);
         }
         if (modAction.HasChildren())
         {
             retActions.AddRange(modAction.Actions.GetActionsByCommandName(name));
         }
     }
     return retActions;
 }
 public ModuleActionCollection(ModuleActionCollection value)
 {
     AddRange(value);
 }
 private void LoadActions(HttpRequest Request)
 {
     _actions = new ModuleActionCollection();
     int maxActionId = Null.NullInteger;
     IActionable actionable = _moduleControl as IActionable;
     if (actionable != null)
     {
         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;
                 }
                 _actions.Add(action);
             }
         }
     }
     int actionCount = GetActionsCount(_actions.Count, _actions);
     if (_nextActionId < maxActionId)
     {
         _nextActionId = maxActionId;
     }
     if (_nextActionId < actionCount)
     {
         _nextActionId = actionCount;
     }
     if (!string.IsNullOrEmpty(Configuration.DesktopModule.BusinessControllerClass))
     {
         if (Configuration.DesktopModule.IsPortable)
         {
             if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "EXPORT", Configuration))
             {
                 _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ExportModule, Localization.GlobalResourceFile), "", "", "action_export.gif", Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportModule", "moduleid=" + ModuleId.ToString()), "", false, SecurityAccessLevel.View, true,
                 false);
             }
             if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "IMPORT", Configuration))
             {
                 _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ImportModule, Localization.GlobalResourceFile), "", "", "action_import.gif", Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportModule", "moduleid=" + ModuleId.ToString()), "", false, SecurityAccessLevel.View, true,
                 false);
             }
         }
         if (Configuration.DesktopModule.IsSearchable && Configuration.DisplaySyndicate)
         {
             AddSyndicateAction();
         }
     }
     string permisisonList = "CONTENT,DELETE,EDIT,EXPORT,IMPORT,MANAGE";
     if (Configuration.ModuleID > Null.NullInteger && ModulePermissionController.HasModulePermission(Configuration.ModulePermissions, permisisonList) && Request.QueryString["ctl"] != "Help")
     {
         AddHelpActions();
     }
     if (Configuration.DisplayPrint)
     {
         AddPrintAction();
     }
     if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Host, "MANAGE", Configuration))
     {
         _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ViewSource, Localization.GlobalResourceFile), ModuleActionType.ViewSource, "", "action_source.gif", Globals.NavigateURL(TabId, "ViewSource", "ctlid=" + Configuration.ModuleControlId.ToString()), false, SecurityAccessLevel.Host, true, false);
     }
     if (!Globals.IsAdminControl() && ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE,MANAGE", Configuration))
     {
         _actions.Add(GetNextActionID(), "~", "", "", "", "", false, SecurityAccessLevel.Anonymous, true, false);
         if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration))
         {
             _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ModuleSettings, Localization.GlobalResourceFile), ModuleActionType.ModuleSettings, "", "action_settings.gif", Globals.NavigateURL(TabId, "Module", "ModuleId=" + ModuleId.ToString()), false, SecurityAccessLevel.Edit, true, false);
         }
         //if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE", Configuration))
         //{
         //    _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.DeleteModule, Localization.GlobalResourceFile), ModuleActionType.DeleteModule, Configuration.ModuleID.ToString(), "action_delete.gif", "", "confirm('" + CommonLibrary.UI.Utilities.ClientAPI.GetSafeJSString(Localization.GetString("DeleteModule.Confirm")) + "')", false, SecurityAccessLevel.View, true, false);
         //}
         if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration))
         {
             _actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.ClearCache, Localization.GlobalResourceFile), ModuleActionType.ClearCache, Configuration.ModuleID.ToString(), "action_refresh.gif", "", false, SecurityAccessLevel.View, true, false);
             AddMenuMoveActions();
         }
     }
 }
 private int GetActionsCount(int count, ModuleActionCollection actions)
 {
     foreach (ModuleAction action in actions)
     {
         if (action.HasChildren())
         {
             count += action.Actions.Count;
             count = GetActionsCount(count, action.Actions);
         }
     }
     return count;
 }
Пример #8
0
 public ModuleActionCollection(ModuleActionCollection value)
 {
     AddRange(value);
 }