Changing CE configuration on the fly

Last post 03-31-2009, 7:35 AM by dtprice. 2 replies.
Sort Posts: Previous Next
  •  03-16-2009, 2:22 PM 49948

    Changing CE configuration on the fly

    The end users of my web pages enter rich text using CE. In order to save page real estate and make CE as simple or as complex as they need, I would like for them to be able to change the autoconfiguration property on the fly. They would select a different configuration from a menu. I would like for the user to be able to do this without reloading the page and possibly loosing the text they have already entered into CE. Any suggestions?
  •  03-19-2009, 11:17 AM 50088 in reply to 49948

    Re: Changing CE configuration on the fly

    >>I would like for them to be able to change the autoconfiguration property on the fly. They would select a different configuration from a menu.
     
     
    Please check this example.
     
    >>I would like for the user to be able to do this without reloading the page
     
    AutoConfigure is a server side property. So the page will reload.
     
    >>and possibly loosing the text they have already entered into CE. Any suggestions?
     
    You can keep the same content when reloading the page.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-31-2009, 7:35 AM 50511 in reply to 50088

    Re: Changing CE configuration on the fly

    Unfortunately the editor text does not reload if the editor is redrawn. After some work on the problem I have a partial solution when an end user is entering new data using CE.
    • First set this property to something like $editor->"myeditor";
    • Next set this property $editor->Text=$_POST['MyEditor'];
    • Now set this property $editor->AutoConfigure=$_SESSION['myconfig'];
    • Add a <select> tag with an id of something like "myconfiglist" with options such as "Change the menu", "All Menu Items", "Limited Menu", "Simple Menu", "My Special Menu" with values "", "Full", "Compact", "Simple", "MySpecial" respectively.
    • For the <select> tag set the attribute onchange = "this.form.submit()" or add a submit button. Keep in mind that the page is posted so other values on the page may change if you aren't careful.
    • At the top of the page add the following php code
    <?php
    If (!empty($_POST['myconfiglist']))
    {
    $_SESSION['myconfig']=$_POST['myconfiglist'];
    }
    else
    {
    $_SESSION['myconfig']="Full";
    }
    ?>
     
    Now the text is reloaded but I can allow the end user to customize the menu. The next task is to set $editor->Text = myrecordsetvalue and allow the end user to customize the menu. I will post the solution when I know it works.
View as RSS news feed in XML