Beispiel #1
0
        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 );
            }
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        private void UpdateTitle(object source, DNNLabelEditEventArgs e)
        {
            if (CanEditModule())
            {
                ModuleInfo moduleInfo = ModuleController.Instance.GetModule(ModuleControl.ModuleContext.ModuleId, ModuleControl.ModuleContext.TabId, false);

                var ps = new PortalSecurity();
                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>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        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 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);
            }
        }
        private void UpdateTitle(object source, DNNLabelEditEventArgs e)
        {
            if (CanEditModule())
            {
                ModuleInfo moduleInfo = ModuleController.Instance.GetModule(ModuleControl.ModuleContext.ModuleId, ModuleControl.ModuleContext.TabId, false);

                moduleInfo.ModuleTitle = e.Text;
                ModuleController.Instance.UpdateModule(moduleInfo);
            }
        }