Example #1
0
 public bool InjectModule(Pane objPane, ModuleInfo objModule)
 {
     bool bSuccess = true;
     try
     {
         objPane.InjectModule(objModule);
     }
     catch (Exception ex)
     {
         ex.ToString();
         bSuccess = false;
     }
     return bSuccess;
 }
Example #2
0
        private bool ProcessSlaveModule()
        {
            ModuleController objModules  = new ModuleController();
            ModuleInfo       objModule   = null;
            ModuleInfo       slaveModule = null;
            int    moduleId = -1;
            string key      = "";
            bool   bSuccess = true;

            if (Request.QueryString["mid"] != null)
            {
                Int32.TryParse(Request.QueryString["mid"], out moduleId);
            }
            if (Request.QueryString["ctl"] != null)
            {
                key = Request.QueryString["ctl"];
            }
            if (Request.QueryString["moduleid"] != null && (key.ToLower() == "module" || key.ToLower() == "help"))
            {
                Int32.TryParse(Request.QueryString["moduleid"], out moduleId);
            }
            if (moduleId != -1)
            {
                objModule = objModules.GetModule(moduleId, PortalSettings.ActiveTab.TabID, false);
                if (objModule != null)
                {
                    slaveModule = objModule.Clone();
                }
            }
            if (slaveModule == null)
            {
                slaveModule             = new ModuleInfo();
                slaveModule.ModuleID    = moduleId;
                slaveModule.ModuleDefID = -1;
                slaveModule.TabID       = PortalSettings.ActiveTab.TabID;
            }
            if (Request.QueryString["moduleid"] != null && (key.ToLower() == "module" || key.ToLower() == "help"))
            {
                slaveModule.ModuleDefID = -1;
            }
            if (Request.QueryString["dnnprintmode"] != "true")
            {
                slaveModule.ModuleTitle = "";
            }
            slaveModule.Header           = "";
            slaveModule.Footer           = "";
            slaveModule.StartDate        = DateTime.MinValue;
            slaveModule.EndDate          = DateTime.MaxValue;
            slaveModule.PaneName         = Common.Globals.glbDefaultPane;
            slaveModule.Visibility       = VisibilityState.None;
            slaveModule.Color            = "";
            slaveModule.Border           = "";
            slaveModule.DisplayTitle     = true;
            slaveModule.DisplayPrint     = false;
            slaveModule.DisplaySyndicate = false;
            slaveModule.ContainerSrc     = PortalSettings.ActiveTab.ContainerSrc;
            if (string.IsNullOrEmpty(slaveModule.ContainerSrc))
            {
                slaveModule.ContainerSrc = PortalSettings.DefaultPortalContainer;
            }
            slaveModule.ContainerSrc  = SkinController.FormatSkinSrc(slaveModule.ContainerSrc, PortalSettings);
            slaveModule.ContainerPath = SkinController.FormatSkinPath(slaveModule.ContainerSrc);
            Pane pane   = null;
            bool bFound = Panes.TryGetValue(Common.Globals.glbDefaultPane.ToLowerInvariant(), out pane);
            ModuleControlInfo objModuleControl = ModuleControlController.GetModuleControlByControlKey(key, slaveModule.ModuleDefID);

            if (objModuleControl != null)
            {
                slaveModule.ModuleControlId = objModuleControl.ModuleControlID;
                slaveModule.IconFile        = objModuleControl.IconFile;
                if (ModulePermissionController.HasModuleAccess(slaveModule.ModuleControl.ControlType, Null.NullString, slaveModule))
                {
                    bSuccess = InjectModule(pane, slaveModule);
                }
                else
                {
                    Response.Redirect(Common.Globals.AccessDeniedURL(MODULEACCESS_ERROR), true);
                }
            }
            return(bSuccess);
        }