Forum

Home » support » Plug-ins » sfTinyMCEConfigPlugin
sfTinyMCEConfigPlugin [message #46552] Wed, 27 February 2008 13:55 Go to next message
vortek  is currently offline vortek
Messages: 16
Registered: October 2007
Location: Braga
Junior Member
I installed the plugin, updated the settings.yml with

   .settings:
      .rich_text_editor_class: TinyMCEExtended


but i can't see any diference.

I use the tinymce as folows:

       fields:
            texto:
                params: rich=true tinymce_options=height:600, width:700, language:'en'


Do i need to enable the plugin somehow?

[Updated on: Wed, 27 February 2008 13:59]

Re: sfTinyMCEConfigPlugin [message #47964 is a reply to message #46552 ] Mon, 17 March 2008 07:33 Go to previous messageGo to next message
Mozzy  is currently offline Mozzy
Messages: 17
Registered: November 2007
Junior Member
Hi there,
Sorry I made a mistake on the readme.
The settings should say
.settings:
  rich_text_editor_class: TinyMCEExtended
Re: sfTinyMCEConfigPlugin [message #48726 is a reply to message #47964 ] Fri, 28 March 2008 15:30 Go to previous messageGo to next message
jillelaine  is currently offline jillelaine
Messages: 212
Registered: January 2008
Location: West Coast
Faithful Member
!! The lib dir is missing in the pear install at this moment.

I installed version 0.0.3 via pear
[natrain@tornado gatr]$ ./symfony plugin-install http://plugins.symfony-project.com/sfTinyMCEConfigPlugin
>> plugin    installing plugin "http://plugi...ject.com/sfTinyMCEConfigPlugin"
>> pear      downloading sfTinyMCEConfigPlugin-0.0.3.tgz ...
...

added to settings.yml: rich_text_editor_class: TinyMCEExtended. But when I went to the page where TinyMCE was previously working, symfony threw an exception.

I downloaded the 0.0.3 .tgz file and see there is a 'lib' dir with sfRichTextEditorTinyMCEExtended.class.php. I copied this lib dir inside the sfTinyMCEConfigPlugin on the server and now the error has gone. Razz

Okay! Now to get to work changing the settings. Thank you for this plugin as it seems it is otherwise difficult to change TinyMCE's config with symfony.

A question -> Can you help me implement the TinyMCE PHP Compressor with this plugin?? http://wiki.moxiecode.com/index.php/TinyMCE:Compressor/PHP I have uploaded the compressor to the server and followed the directions on the TinyMCE wiki page above, but it is not working. I have a form with 5 TinyMCE textareas, and hope the compressor will make the page faster to load.

I see these lines in sfRichTextEditorTinyMCEExtended.class.php
    // use tinymce's gzipped js?
    $tinymce_file = _get_option($options, 'tinymce_gzip') ? '/tiny_mce_gzip.php' : '/tiny_mce.js';

same as they are in symfony's sfRichTextEditorTinyMCE code, but even though I have tiny_mce_gzip.php in the tiny_mce dir, and the line
<script type="text/javascript" src="/js/tiny_mce/tiny_mce_gzip.js"></script>

in my layout, the gzip is not used. Can you explain what I am doing wrong? Confused

I have TinyMCE 3.0.5 on symfony 1.0.11.

[Updated on: Fri, 28 March 2008 16:03]

Re: sfTinyMCEConfigPlugin [message #49116 is a reply to message #48726 ] Thu, 03 April 2008 15:56 Go to previous messageGo to next message
Mozzy  is currently offline Mozzy
Messages: 17
Registered: November 2007
Junior Member
Thanks for finding out the problem. I fixed the package.xml now to include the lib folder properly.

As for you gzip problem:
Did you set the 'tinymce_gzip' in your parameters to true?
Re: sfTinyMCEConfigPlugin [message #49155 is a reply to message #49116 ] Fri, 04 April 2008 04:24 Go to previous messageGo to next message
jillelaine  is currently offline jillelaine
Messages: 212
Registered: January 2008
Location: West Coast
Faithful Member
Okay, I tried this in tiny_mce.yml (Is this the right place...and right line...to put the line 'tinymce_gzip: true' within the tiny_mce.yml file?):
options:
  mode: exact
  tinymce_gzip: true

and this is what I see in 'view source'
<script type="text/javascript">
//<![CDATA[
tinyMCE.init({mode: 'exact', language: "en", elements: "course_description_description", plugins: "table,paste", theme: 'advanced', theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_path_location: "bottom", theme_advanced_buttons1: "separator,bold,italic,underline,separator,undo,redo,separator,justifyleft,justifycenter,justifyright,separator,fontsizeselect,forecolorpicker,backcolorpicker,separator,link,unlink,separator",
theme_advanced_buttons2: "separator,bullist,numlist,separator,outdent,indent,separator,tablecontrols,separator",
theme_advanced_buttons3: "separator,hr,separator,code,removeformat,separator,pastetext,pasteword,selectall,separator", extended_valid_elements: "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]", relative_urls: false, debug: false,height:300,width:600});
//]]>
</script>


If the gzip was working, the script would start:
tinyMCE_GZ.init({mode: 'exact' ...

I looked at sfRichTextEditorTinyMCEExtended.class.php and see the code that creates the script:
$tinymce_js = 'tinyMCE.init({';
    // Mode
    $tinymce_js .= "mode: '$mode'";
    // Language
    $tinymce_js .= ', language: "'.strtolower(substr($culture, 0, 2)).'"';
    // Elements
    $tinymce_js .= ', elements: "'.$id.'"';
    // Plugins
    if ($plugins) {
      $tinymce_js .= ', plugins: "'.$plugins.'"';
    }
    // Theme
    $tinymce_js .= ", theme: '$theme'";
    // Toolbar
    $tinymce_js .= ', theme_'.$theme.'_toolbar_location: "'.$tbLocation.'"';
    $tinymce_js .= ', theme_'.$theme.'_toolbar_align: "'.$tbAlign.'"';
    $tinymce_js .= ', theme_'.$theme.'_path_location: "'.$pathLocation.'"';
    // Buttons
    if ($buttons) {
      $tinymce_js .= ', '.$buttons;
    }
    // Extended Valid Elements
    $tinymce_js .= ', extended_valid_elements: '.$extendedValidElements;
    // Relative Urls
    $tinymce_js .= ', relative_urls: '.$relativeUrls;
    // Debug
    $tinymce_js .= ', debug: '.$debug;

    // Custom Options
    $tinymce_js .= ($tinymce_options ? ','.$tinymce_options : '');
    $tinymce_js .= (isset($options['tinymce_options']) ? ','.$options['tinymce_options'] : '');

    if (isset($config['options']['misc']))
    {
      foreach ( $config['options']['misc'] as $name => $value)
      {
        $tinymce_js .= ", $name: \"$value\"";
      }
    }
    
    if (isset($options['tinymce_options'])) {
      unset($options['tinymce_options']);
    }
    $tinymce_js .= '});';

I'm not sure how tinyMCE_GZ.init({ would ever be created from this code, even if the option tinymce_gzip: true was recognized? Perhaps this code would work with an older version of TinyMCE: I have 3.0.5.

Well, the gzip would be nice if it is possible -> but please understand that I like this plugin VERY much already! It is handy and easy to use. Thank you!
sfTinyMCEConfigPlugin add buttons [message #51298 is a reply to message #46552 ] Sat, 03 May 2008 05:10 Go to previous messageGo to next message
abdel2388  is currently offline abdel2388
Messages: 9
Registered: April 2008
Junior Member
i'm using sfTinyMCEConfigPlugin and i wish add some buttons like in the examples of the tnyMCE (in installation folder) because i need add pictures to the text, i have tried so much but without a result Sad Sad
how i can add buttons ??
tnx
Re: sfTinyMCEConfigPlugin add buttons [message #51320 is a reply to message #51298 ] Sat, 03 May 2008 20:23 Go to previous messageGo to next message
jillelaine  is currently offline jillelaine
Messages: 212
Registered: January 2008
Location: West Coast
Faithful Member
Please check your settings.yml
all:
  .settings:
     rich_text_editor_class:   TinyMCEExtended

Make sure indentation is correct and that there is a colon : after the .settings:

If you look at the code for the plugin, http://trac.symfony-project.com/wiki/sfTinyMCEConfigPlugin, you will see that not all TinyMCE configuration options http://wiki.moxiecode.com/index.php/TinyMCE:Configuration are enabled with this plugin.

If you want to add the 'official' button to upload and insert an image with the TinyMCE, it is not free: http://tinymce.moxiecode.com/paypal/item_imagemanager.php

But there are perhaps other solutions:
http://pascal.vanhecke.info/2005/08/25/image-upload-plugin-f or-tinymce/
http://www.symfony-project.org/forum/index.php/t/6243/
or you might try the FCKeditor, which comes with a file upload/insert button for free: http://trac.symfony-project.com/wiki/HowToUseFCKeditor

Good luck!

[Updated on: Sat, 03 May 2008 22:04]

Re: sfTinyMCEConfigPlugin [message #51322 is a reply to message #48726 ] Sat, 03 May 2008 20:55 Go to previous messageGo to next message
Mozzy  is currently offline Mozzy
Messages: 17
Registered: November 2007
Junior Member
Hi there,
Sorry I have been busy lately.

I meant rather wif you have set the tinymce_gzip option of the helper function to true...

For example:
<?php echo textarea_tag('name', 'default content', 'rich=true size=10x20 tinymce_options=gzip:true')) ?>


This should do the trick
Re: sfTinyMCEConfigPlugin add buttons [message #51341 is a reply to message #51298 ] Sun, 04 May 2008 09:53 Go to previous messageGo to next message
Mozzy  is currently offline Mozzy
Messages: 17
Registered: November 2007
Junior Member
Basically after you successfully installed the plugin (and all configurations are correct) then you can any button/plugin you want via the tiny_mce.yml

NOTE: To have certain buttons enabled, don't forget to add the corresponding plugin to the plugins list.
Re: sfTinyMCEConfigPlugin [message #51352 is a reply to message #51322 ] Sun, 04 May 2008 12:55 Go to previous messageGo to next message
jillelaine  is currently offline jillelaine
Messages: 212
Registered: January 2008
Location: West Coast
Faithful Member
Thanks Mozzy. I will be gone for a few days but will test this when I get back. I would be nice to have the gzip working! Thanks again for this nice plugin.
Re: sfTinyMCEConfigPlugin [message #52174 is a reply to message #46552 ] Fri, 16 May 2008 10:46 Go to previous messageGo to next message
jeanmonod  is currently offline jeanmonod
Messages: 6
Registered: April 2008
Location: Switzerland
Junior Member
Hi all,

I'm trying to use the plugin with css parameters.

I would like that the style drop down list appears when I specified a css, but is not the case...

Looking at the code, it'seems that it have been plane to do it as there is a variable $style_selector that is create. But unfortunatly it's never used? Is there a particular raison that this variable haven't been used? Mozzy maybe you know? Smile

Thanks

David
Re: sfTinyMCEConfigPlugin [message #53494 is a reply to message #46552 ] Wed, 04 June 2008 19:54 Go to previous message
wtfowned  is currently offline wtfowned
Messages: 8
Registered: May 2008
Junior Member
in example yaml file we can see that "debug" key is lower level than "options" key , at class code:
$debug = $config['options']['debug'] ? 'true' : 'false';
so it should be :
$debug = $config['debug'] ? 'true' : 'false';

Also i have 2 additional errors:
Strict Standards: Creating default object from empty value in /usr/share/php/symfony/util/Spyc.class.php on line 200

Notice: Undefined property: stdClass::$data in /usr/share/php/symfony/util/Spyc.class.php on line 201
string(5) "false"

As i understand its problem with my .yaml file ?
Can anyone please show his normal tiny_mce.yaml file ? -)
Thx
Previous Topic:sfLucene error
Next Topic:Doctrine constructor preventing build-sql, etc
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software