Exemplo n.º 1
0
 protected void SetPreviewMode(bool isPreview)
 {
     if (isPreview)
     {
         Personalization.SetProfile("Usability", "UserMode" + PortalSettings.PortalId, "View");
     }
     else
     {
         Personalization.SetProfile("Usability", "UserMode" + PortalSettings.PortalId, "Edit");
     }
 }
Exemplo n.º 2
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 ///   Rebinds the grid
 /// </summary>
 /// <param name = "sender"></param>
 /// <param name = "e"></param>
 /// <remarks>
 /// </remarks>
 /// <history>
 ///   [vmasanas]	25/03/2006	Created
 ///   [erikvb]    24/02/2010  added personalization
 /// </history>
 /// -----------------------------------------------------------------------------
 private void rbMode_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Personalization.SetProfile("LanguageEditor", "Mode" + PortalSettings.PortalId, rbMode.SelectedValue);
         BindGrid(true);
     }
     catch
     {
         UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Save.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning);
     }
 }
Exemplo n.º 3
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 ///   Rebinds the grid
 /// </summary>
 /// <param name = "sender"></param>
 /// <param name = "e"></param>
 /// <remarks>
 /// </remarks>
 /// <history>
 ///   [vmasanas]	25/03/2006	Created
 /// </history>
 /// -----------------------------------------------------------------------------
 private void chkHighlight_CheckedChanged(Object sender, EventArgs e)
 {
     try
     {
         Personalization.SetProfile("LanguageEditor", "HighLight" + PortalSettings.PortalId, chkHighlight.Checked.ToString());
         BindGrid(true);
         //Module failed to load
     }
     catch (Exception exc)
     {
         DnnLog.Error(exc);
         UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Save.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning);
     }
 }
Exemplo n.º 4
0
        protected void chkColorCoding_CheckedChanged(Object sender, EventArgs e)
        {
            int i;

            if (chkColorCoding.Checked)
            {
                i                   = 1;
                ColorCodingOn       = true;
                ColorCodingLegendOn = true;
                Personalization.SetProfile("LogViewer", "ColorCodingLegend", "1");
            }
            else
            {
                i                   = 0;
                ColorCodingOn       = false;
                ColorCodingLegendOn = false;
            }
            Personalization.SetProfile("LogViewer", "ColorCoding", i);
            BindData();
        }
Exemplo n.º 5
0
 private void AutoEditMode()
 {
     if (!Page.IsPostBack)
     {
         if (HttpContext.Current != null && HttpContext.Current.Request.IsAuthenticated)
         {
             var defaultMode = ModuleContext.PortalSettings.DefaultControlPanelMode;
             if (defaultMode == PortalSettings.Mode.Edit)
             {
                 string setting = Convert.ToString(Personalization.GetProfile("Usability", "UserMode" + PortalSettings.Current.PortalId));
                 //if (!IsPageAdmin() & IsModuleAdmin())
                 {
                     if (setting != "EDIT")
                     {
                         Personalization.SetProfile("Usability", "UserMode" + PortalSettings.Current.PortalId, "EDIT");
                         //Page.Response.AppendHeader("X-UserMode", setting + "/" + IsPageAdmin() + "/" + IsModuleAdmin());
                     }
                     JavaScript.RequestRegistration(CommonJs.DnnPlugins); // avoid js error
                 }
             }
         }
         //string  usermode = "" + DotNetNuke.Services.Personalization.Personalization.GetProfile("Usability", "UserMode" + PortalSettings.Current.PortalId);
     }
 }
Exemplo n.º 6
0
 private void SaveUserSetting(string key, object val)
 {
     Personalization.SetProfile(ModuleConfiguration.ModuleDefinition.FriendlyName, PersonalizationKey(key), val);
 }
Exemplo n.º 7
0
        protected void CmdAddModuleClick(object sender, EventArgs e)
        {
            if (TabPermissionController.CanAddContentToPage() && this.CanAddModuleToPage())
            {
                int permissionType;
                try
                {
                    permissionType = int.Parse(this.VisibilityLst.SelectedValue);
                }
                catch (Exception exc)
                {
                    Logger.Error(exc);

                    permissionType = 0;
                }

                int position = -1;
                switch (this.PositionLst.SelectedValue)
                {
                case "TOP":
                    position = 0;
                    break;

                case "ABOVE":
                    if (!string.IsNullOrEmpty(this.PaneModulesLst.SelectedValue))
                    {
                        try
                        {
                            position = int.Parse(this.PaneModulesLst.SelectedValue) - 1;
                        }
                        catch (Exception exc)
                        {
                            Logger.Error(exc);

                            position = -1;
                        }
                    }
                    else
                    {
                        position = 0;
                    }

                    break;

                case "BELOW":
                    if (!string.IsNullOrEmpty(this.PaneModulesLst.SelectedValue))
                    {
                        try
                        {
                            position = int.Parse(this.PaneModulesLst.SelectedValue) + 1;
                        }
                        catch (Exception exc)
                        {
                            Logger.Error(exc);

                            position = -1;
                        }
                    }
                    else
                    {
                        position = -1;
                    }

                    break;

                case "BOTTOM":
                    position = -1;
                    break;
                }

                int moduleLstID;
                try
                {
                    moduleLstID = int.Parse(this.ModuleLst.SelectedValue);
                }
                catch (Exception exc)
                {
                    Logger.Error(exc);

                    moduleLstID = -1;
                }

                if (moduleLstID > -1)
                {
                    if (this.AddExistingModule.Checked)
                    {
                        int pageID;
                        try
                        {
                            pageID = int.Parse(this.PageLst.SelectedValue);
                        }
                        catch (Exception exc)
                        {
                            Logger.Error(exc);

                            pageID = -1;
                        }

                        if (pageID > -1)
                        {
                            this.DoAddExistingModule(moduleLstID, pageID, this.PaneLst.SelectedValue, position, string.Empty, this.chkCopyModule.Checked);
                        }
                    }
                    else
                    {
                        DoAddNewModule(this.Title.Text, moduleLstID, this.PaneLst.SelectedValue, position, permissionType, string.Empty);
                    }
                }

                // set view mode to edit after add module.
                if (this.PortalSettings.UserMode != PortalSettings.Mode.Edit)
                {
                    Personalization.SetProfile("Usability", "UserMode" + this.PortalSettings.PortalId, "EDIT");
                }

                this.Response.Redirect(this.Request.RawUrl, true);
            }
        }
Exemplo n.º 8
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Sets the current Visible Mode.
 /// </summary>
 /// <param name="isVisible">A flag indicating whether the Control Panel should be visible.</param>
 /// -----------------------------------------------------------------------------
 protected void SetVisibleMode(bool isVisible)
 {
     Personalization.SetProfile("Usability", "ControlPanelVisible" + this.PortalSettings.PortalId, isVisible.ToString());
 }
Exemplo n.º 9
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Sets the UserMode.
 /// </summary>
 /// <param name="userMode">The userMode to set.</param>
 /// -----------------------------------------------------------------------------
 protected void SetUserMode(string userMode)
 {
     Personalization.SetProfile("Usability", "UserMode" + this.PortalSettings.PortalId, userMode.ToUpper());
 }
Exemplo n.º 10
0
 protected void SetContentMode(bool showContent)
 {
     Personalization.SetProfile("Usability", "ContentVisible" + PortalSettings.PortalId, showContent.ToString());
 }