EzOE with Tiny MCE changes

Author Message

Håkan Bergman

Monday 10 May 2010 5:09:34 am

Hello,

I have been reading the guide for OE 5.x and I can't seem to find how selectfont works. The standard seem to have paragraph, quote, header 1-6. I checked the template and added something like "p2" but it shows like an empty row in the selected list.

I tried to add something just to see if / how it works and it didn't.
In the .tpl file in edit directory I added "p2" as a blockformat and also copied p as p2 in valid_elements just to see an output. The list is incremented by one line which is white with no text name. I want my "p2" to have name "imagetext" as a <p> tag with class "imagetext". I also want to rename "paragraph" to "brödtext" to make it easier for the users to know what to choose from, as the name paragraph is not clear of what kind of text that will be shown in the article.

Best regards,

Håkan Bergman

André R.

Monday 10 May 2010 2:16:44 pm

Don't know about selectfont, but formatselect is implemented like this in ez theme (only small changes to the original advance theme code to comment out unsupported html types). You would have finded it easily by searching for theme_advanced_blockformats, the setting I presume you changed:

 _createBlockFormats : function() {
var c, fmts = {
                p : 'advanced.paragraph',
                //address : 'advanced.address',
                pre : 'advanced.pre',
                h1 : 'advanced.h1',
                h2 : 'advanced.h2',
                h3 : 'advanced.h3',
                h4 : 'advanced.h4',
                h5 : 'advanced.h5',
                h6 : 'advanced.h6'/*,
                div : 'advanced.div',
                blockquote : 'advanced.blockquote',
                code : 'advanced.code',
                dt : 'advanced.dt',
                dd : 'advanced.dd',
                samp : 'advanced.samp'*/
            }, t = this;
        c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});
        if (c) {
            each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k)
            {
                c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
            });
        }

So to add new entries you'll have to hack the theme to add it to fmts.
But, classes are not supported, so' you'll have to hack both the theme and parts of TinyMCE to add support for that.
This is why I haven't bothered to customize it yet to be able to set it from ezoe.ini, without class support it is pretty pointless.

As for changing name of paragraph, that's simple(well, kind of). ezoe uses a ezjscore server call to handle eZ Publish to TinyMCE translation integration. And you can find the stuff doing it in ezoeServerFunctions::i18n():

 'paragraph' => ezi18n( 'design/standard/ezoe', "Paragraph"),

So unless you need to change it for eng-GB, you'll be able to override it with translation "override", basically overriding the string in a translation file in an extension that have higher priority then ezoe. ref:

<!DOCTYPE TS>
<TS>
<context>
 <name>design/standard/ezoe</name>
 <message>
        <source>Paragraph</source>
        <translation>Paragraf</translation>
</message>
</context>
</TS> 

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 19:36:01
Script start
Timing: Jan 30 2025 19:36:01
Module start 'layout'
Timing: Jan 30 2025 19:36:01
Module start 'content'
Timing: Jan 30 2025 19:36:01
Module end 'content'
Timing: Jan 30 2025 19:36:01
Script end

Main resources:

Total runtime0.0273 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.1328151.2109
Module start 'layout' 0.00500.0047 739.3438220.6875
Module start 'content' 0.00980.0158 960.03131,001.9141
Module end 'content' 0.02550.0017 1,961.945333.9922
Script end 0.0272  1,995.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003412.3968140.0002
Check MTime0.00114.1361140.0001
Mysql Total
Database connection0.00062.175210.0006
Mysqli_queries0.00248.962230.0008
Looping result0.00000.066510.0000
Template Total0.00114.210.0011
Template load0.00093.367310.0009
Template processing0.00020.821310.0002
Override
Cache load0.00062.333510.0006
General
dbfile0.00259.160780.0003
String conversion0.00000.028940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs