private void UpdateTitle(object source, DNNLabelEditEventArgs e) { if (CanEditModule()) { var moduleController = new ModuleController(); ModuleInfo moduleInfo = moduleController.GetModule(ModuleControl.ModuleContext.ModuleId, ModuleControl.ModuleContext.TabId, false); moduleInfo.ModuleTitle = e.Text; moduleController.UpdateModule(moduleInfo); } }
protected void lblTitle_UpdateLabel(object source, DNNLabelEditEventArgs e) { if (CanEditModule()) { ModuleController objModule = new ModuleController(); PortalModuleBase objPortalModule = Container.GetPortalModuleBase(this); ModuleInfo objModInfo = objModule.GetModule(objPortalModule.ModuleId, objPortalModule.TabId, false); objModInfo.ModuleTitle = e.Text; objModule.UpdateModule(objModInfo); } }
private void UpdateTitle(object source, DNNLabelEditEventArgs e) { if (this.CanEditModule()) { ModuleInfo moduleInfo = ModuleController.Instance.GetModule(this.ModuleControl.ModuleContext.ModuleId, this.ModuleControl.ModuleContext.TabId, false); var ps = PortalSecurity.Instance; var mt = ps.InputFilter(e.Text, PortalSecurity.FilterFlag.NoScripting); moduleInfo.ModuleTitle = mt; ModuleController.Instance.UpdateModule(moduleInfo); } }
/// <summary> /// lblContent_UpdateLabel allows for inline editing of content /// </summary> /// <param name="source"></param> /// <param name="e"></param> private void lblContent_UpdateLabel(object source, DNNLabelEditEventArgs e) { try { // verify security if ((!new PortalSecurity().InputFilter(e.Text, PortalSecurity.FilterFlag.NoScripting).Equals(e.Text))) { throw new SecurityException(); } else if (EditorEnabled && IsEditable && PortalSettings.UserMode == PortalSettings.Mode.Edit) { // get content var htmlTextController = new HtmlTextController(); HtmlTextInfo htmlText = htmlTextController.GetTopHtmlText(ModuleId, CurrentLocaleCode, true); if (htmlText == null) { htmlText = new HtmlTextInfo(); htmlText.ItemId = -1; // use current display title for new item only htmlText.ModuleTitle = ModuleContext.Configuration.ModuleTitle; } // set content attributes htmlText.ModuleId = ModuleId; htmlText.Locale = CurrentLocaleCode; htmlText.Content = Server.HtmlEncode(e.Text); htmlText.IsPublished = true; // save the content with new version htmlTextController.UpdateHtmlText(htmlText, true, htmlTextController.GetMaximumVersionHistory(PortalId)); //refresh module cache ModuleController.SynchronizeModule(ModuleId); } else { throw new SecurityException(); } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
/// ----------------------------------------------------------------------------- /// <summary> /// lblContent_UpdateLabel allows for inline editing of content /// </summary> /// <remarks> /// </remarks> /// ----------------------------------------------------------------------------- private void lblContent_UpdateLabel(object source, DNNLabelEditEventArgs e) { try { // verify security if ((!PortalSecurity.Instance.InputFilter(e.Text, PortalSecurity.FilterFlag.NoScripting).Equals(e.Text))) { throw new SecurityException(); } else if (EditorEnabled && IsEditable && PortalSettings.UserMode == PortalSettings.Mode.Edit) { // get content var objHTML = new HtmlTextController(); var objWorkflow = new WorkflowStateController(); HtmlTextInfo objContent = objHTML.GetTopHtmlText(ModuleId, false, WorkflowID); if (objContent == null) { objContent = new HtmlTextInfo(); objContent.ItemID = -1; } // set content attributes objContent.ModuleID = ModuleId; objContent.Content = Server.HtmlEncode(e.Text); objContent.WorkflowID = WorkflowID; objContent.StateID = objWorkflow.GetFirstWorkflowStateID(WorkflowID); // save the content objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(PortalId)); } else { throw new SecurityException(); } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }