This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

using sfWidgetFormTextareaTinyMCE and not loading the editor anymore

Forum to discuss ExtJS and other JS plugins

using sfWidgetFormTextareaTinyMCE and not loading the editor anymore

by pingala » Sun Jul 12, 2009 7:01 pm

Yesterday I was working with the TinyMCE and I got it to work as I want to using the sfWidgetFormTextareaTinyMCE.

Today after playing with the sfGuard and sfADminDash and creating the backend, my TinyMCE settings from the BaseForm class disappeared it looks like something wiped it out and returned it to the original form :(~ :-(~ :sad:

after installing the sfGuard I did changed something in the schema so I ran again the build form,model,etc. I think this had destroyed what I've done yesterday and now I can't get tinymce to work again .. :(~ :-(~ :sad:

So I've recreated the form as I remembered (no I'm not using a versioning system, which now I regret), in /lib/form/base/BaseConceptForm.class.php within the method setup and the array $this->setWidgets:

Code: Select all
      'description'    => new sfWidgetFormTextareaTinyMCE(
      array(
        'width'=>500,
        'height'=>350,
        'theme'=>'advanced',
        'config'  =>  '
                       theme_advanced_disable: "anchor,help",
                       skin: "o2k7",
                       skin_variant: "silver",
                       elements: "elm2",
                       plugins:"spellchecker,insertdatetime,searchreplace,paste,",                                             
                       theme_advanced_buttons1 : "mybutton,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
                       theme_advanced_buttons2 : "",
                       theme_advanced_buttons3 : "",
                       theme_advanced_toolbar_location : "top",
                       theme_advanced_toolbar_align : "left",
                       theme_advanced_statusbar_location : "bottom",
                       theme_advanced_resizing: "false"                       
                       
                       '),array(
            'class' => 'tinyMCE',
        )
      ),   


the setting.yml contains the variable to point at correct tinyMCE js location.

When I go to the page which should contain the editor (it's the edit page for that object) I can see the whole code created correctly and Firebug is not even giving me any error of any sort (JS,CSS,etc.)... the code rendered is like this:

Code: Select all
<tr>
  <th><label for="concept_description">Description</label></th>

  <td><textarea class="tinyMCE" name="concept[description]" id="concept_description">some random text</textarea>
<script type="text/javascript">
  tinyMCE.init({
    mode:                              "exact",
    theme:                             "advanced",
    elements:                          "concept_description",
    width:                             "500px",
    height:                            "350px",
   
                       theme_advanced_disable: "anchor,help",
                       skin: "o2k7",
                       skin_variant: "silver",
                       elements: "elm2",
                       plugins:"spellchecker,insertdatetime,searchreplace,paste,",                                             
                       theme_advanced_buttons1 : "mybutton,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
                       theme_advanced_buttons2 : "",
                       theme_advanced_buttons3 : "",
                       theme_advanced_toolbar_location : "top",
                       theme_advanced_toolbar_align : "left",
                       theme_advanced_statusbar_location : "bottom",
                       theme_advanced_resizing: "false"                       
                       
                       
  });
</script><br />Enter the full text of the concept</td>
</tr>


When I load the page, I can see the textarea which contains my text but it is not surrounded with the TinyMCE editor anymore.

Any clever idea? I'm getting insane with this :(~ :-(~ :sad:

Thanks
Cheers.
pingala
Member
 
Posts: 42
Joined: Fri Jan 30, 2009 4:45 pm
Location: Dublin, Ireland

Re: using sfWidgetFormTextareaTinyMCE and not loading the editor anymore

by pingala » Tue Jul 14, 2009 3:33 pm

Does anybody have any idea on how I can solve/approach this?

I must incorporate a rich customizable editor in my application, I hope I can get it to work shortly otherwise I have to drop symfony and move to something else. :(~ :-(~ :sad:

any idea/suggestion is appreciated.

thanks.
pingala
Member
 
Posts: 42
Joined: Fri Jan 30, 2009 4:45 pm
Location: Dublin, Ireland