protected void OnDeleteTab(object sender, EventArgs args)
        {
            PortalDefinition.Tab t = PortalDefinition.GetCurrentTab();
            PortalDefinition.DeleteTab(t.reference);

            if (t.parent == null)
            {
                Response.Redirect(Helper.GetTabLink(""));
            }
            else
            {
                Response.Redirect(Helper.GetTabLink(t.parent.reference));
            }
        }
        override protected void OnInit(EventArgs e)
        {
            PortalDefinition.Tab tab = PortalDefinition.GetCurrentTab();

            if (UserManagement.HasViewRights(Page.User, tab.roles))
            {
                // Render
                RenderModules(left, tab, tab.left);
                RenderModules(middle, tab, tab.middle);
                RenderModules(right, tab, tab.right);
            }

            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            InitializeComponent();
            base.OnInit(e);
        }
Example #3
0
        /// <summary>
        /// Returns the proper edit ascx Control. Uses the current Page to load the Control.
        /// If the user has no right a error control is returned
        /// </summary>
        /// <param name="p">The current Page</param>
        /// <returns>Edit ascx Control</returns>
        internal static Control GetEditControl(Page p)
        {
            PortalDefinition.Tab    tab = PortalDefinition.GetCurrentTab();
            PortalDefinition.Module m   = tab.GetModule(p.Request["ModuleRef"]);

            if (!UserManagement.HasEditRights(HttpContext.Current.User, m.roles))
            {
                // No rights, return a error Control
                Label l = new Label();
                l.CssClass = "Error";
                l.Text     = "Access denied!";
                return(l);
            }
            m.LoadModuleSettings();
            Module em = null;

            if (m.moduleSettings != null)
            {
                // Module Settings are present, use custom ascx Control
                em = (Module)p.LoadControl(Config.GetModuleVirtualPath(m.type) + m.moduleSettings.editCtrl);
            }
            else
            {
                // Use default ascx control (Edit[type].ascx)
                em = (Module)p.LoadControl(Config.GetModuleVirtualPath(m.type) + "Edit" + m.type + ".ascx");
            }

            // Initialize the control
            em.InitModule(
                tab.reference,
                m.reference,
                Config.GetModuleVirtualPath(m.type),
                true);

            return(em);
        }