Problems with Online Editor 4.0.1

Author Message

Bjørn Sandvik

Tuesday 10 January 2006 1:00:12 am

We have installed the laster version of Online Editor (4.0.1) and face some problems:

If I insert a new factbox in the Online Editor it generates the code:

<table class='custom' border='1' width='100%'>
<tr>
<td class='factbox'>This is a factbox</td>
</tr>
</table>

This code is genereated in the Online Editor, and not in my override template.
Is this how it should be? I would like to format the factbox using css rather than tables.

How is it possbile to override editor_classes.css for different siteaccesses?

http://blog.thematicmapping.org
http://www.globalis.no

Kirill Subbotin

Tuesday 10 January 2006 3:53:25 am

Sorry, its a bug that appears only in IE browser.
Will be fixed in 4.0.2, that will be released today.

Meanwhile you can aplly a patch: (you should actually replace just one line)

Index: ezxmltext/handlers/input/ezdhtmlxmlinput.php
===================================================================
--- ezxmltext/handlers/input/ezdhtmlxmlinput.php        (revision 9337)
+++ ezxmltext/handlers/input/ezdhtmlxmlinput.php        (working copy)
@@ -1727,7 +1727,7 @@
         $attributeString = preg_replace( "/ +([a-zA-Z0-9:-_#\-]+) *\='(.*?)'/e", "' \\1'.'=\"'.'\\2'.'\"'", ' ' . $attributeString );
 
         // Convert no quotes to double quotes and remove extra spaces
-        $attributeString = preg_replace( "/ +([a-zA-Z0-9:-_#\-]+) *\= *([^\s'\"]+) */e", "' \\1'.'=\"'.'\\2'.'\" '", $attributeString );
+        $attributeString = preg_replace( "/ +([a-zA-Z0-9:-_#\-]+) *\= *([^\s'\"]+)/e", "' \\1'.'=\"'.'\\2'.'\" '", $attributeString );
 
         // Split by quotes followed by spaces
         $attributeArray = preg_split( "#(?<=\") +#", $attributeString );

Kirill Subbotin

Tuesday 10 January 2006 4:07:28 am

Concerning your second question: You can just create new dir within design directory of the extension and move file there:

/extension/ezdhtml/design/<siteaccess_name>/stylesheets/ezdhtml/editor_classes.css

I have never tested this, although it should work!

Another way can be setting different parameter
EditorCSSFileList[] in your design.ini in different siteaccesses.

PS. It would be interesting to know does it work for you or not!

Bjørn Sandvik

Tuesday 10 January 2006 4:16:02 am

I think there is one more bug:
I'm not able to change the size of a picture that is embedded. If I cange the size to "large" it stil shows medium when the object is published.

http://blog.thematicmapping.org
http://www.globalis.no

Kirill Subbotin

Tuesday 10 January 2006 6:02:57 am

Yes, this bug also existed. But I believe it is fixed with the same patch.
Can you test it ?

Bjørn Sandvik

Tuesday 10 January 2006 6:21:10 am

I don't quite understand what codeline I should change. Could you give me all the code for "function parseAttributes_( $attributeString )" (line 1724). I guess thats the place where the bug is.

http://blog.thematicmapping.org
http://www.globalis.no

Kirill Subbotin

Tuesday 10 January 2006 6:45:26 am

Yes, here it is:

    function parseAttributes_( $attributeString )
    {
        // Convert single quotes to double quotes
        $attributeString = preg_replace( "/ +([a-zA-Z0-9:-_#\-]+) *\='(.*?)'/e", "' \\1'.'=\"'.'\\2'.'\"'", ' ' . $attributeString );

        // Convert no quotes to double quotes and remove extra spaces
        $attributeString = preg_replace( "/ +([a-zA-Z0-9:-_#\-]+) *\= *([^\s'\"]+)/e", "' \\1'.'=\"'.'\\2'.'\" '", $attributeString );

        // Split by quotes followed by spaces
        $attributeArray = preg_split( "#(?<=\") +#", $attributeString );

        $attributes = array();
        foreach( $attributeArray as $attrStr )
        {
            if ( !$attrStr || strlen( $attrStr ) < 4 )
                continue;

            list( $attrName, $attrValue ) = split( '="', $attrStr );

            $attrName = strtolower( trim( $attrName ) );
            if ( !$attrName )
                continue;

            $attrValue = substr( $attrValue, 0, -1 );
            if ( $attrValue === '' || $attrValue === false )
                continue;

            $attributes[$attrName] = $attrValue;
        }

        return $attributes;
    }

Bjørn Sandvik

Tuesday 10 January 2006 7:04:39 am

It works! Thank you!

I'm now able to make a factbox and lagre pictures again.
http://www.fn.no/utspill_og_artikler/spent_situasjon_paa_afrikas_horn

http://blog.thematicmapping.org
http://www.globalis.no

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