xoops forums

chco2

Module Developer
Posted on: 2009/8/21 19:37
chco2
chco2 (Show more)
Module Developer
Posts: 374
Since: 2004/3/5 1
#1

Editors in 2.4.0 beta

Hi!

Just installed a completely new fresh 2.4 beta.
One thing I noticed that in both the news module and the wfchannel most editors are available, but only dhtml seems to work. And in wfchannel I cannot even choose that editor.

Anyone any suggestions?

thnx

trabis

Core Developer
Posted on: 2009/8/28 10:08
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#2

Re: Editors in 2.4.0 beta

Hi,

First step after installing new pack of editors is clearing xoops_data/caches/xoops_cache. This will make new editors available.

Fix for news module:
Edit news/include/functions.php and make this change:
function news_isX22()
{
    return (
substr(XOOPS_VERSION09) >= "XOOPS 2.2") ? true false;
}


For wfchannel we have to look into wfresource first.
Open file wfresource/class/xoopsforms/formelement.php and make sure the file ends like this:
/**
     * Generates output for the element.
     *
     * This method is abstract and must be overwritten by the child classes.
     *
     * @abstract
     */
    
function render() {
    }
    
     
/**
     * get the caption for the element
     *
     * @param bool $encode To sanitizer the text?
     * @return string
     */
    
function getTitle($encode false)
    {
        if (
strlen($this->_description)>0)
            return 
$encode htmlspecialchars(strip_tags($this->_caption.' - '.$this->_description), ENT_QUOTES) : strip_tags($this->_caption.' - '.$this->_description);
        else
            return 
$encode htmlspecialchars(strip_tags($this->_caption), ENT_QUOTES) : strip_tags($this->_caption);
    }
}

?>

hervet

Friend of XOOPS
Posted on: 2009/8/28 12:30
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#3

Re: Editors in 2.4.0 beta

Quote:

trabis wrote:
Fix for news module:
Edit news/include/functions.php and make this change:

Isn't there a better way to do it ?
I'm not going to make a new version of this code each time a new version of XOOPS is released.
It's time to make something definitive AND running ...

This point is becoming more than boring.
The way to use editors is changing every time, please stop this, fix one or two editors (a simple textaread AND an html area) and stop this slaughter.

Modifying code of running module to adapt to a BETA version is not the best idea too.

trabis

Core Developer
Posted on: 2009/8/28 12:38
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#4

Re: Editors in 2.4.0 beta

Quote:

hervet wrote:

This point is becoming more than boring.
The way to use editors is changing every time, please stop this, fix one or two editors (a simple textaread AND an html area) and stop this slaughter.



The way of using editors did not change. The only problem was the change of version number from 2.3 to 2.4. You can assume that future versions of XOOPS will use same method for editors so it is best to check if version is bigger than 2.2 that checking against a fix number.

hervet

Friend of XOOPS
Posted on: 2009/8/28 12:59
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#5

Re: Editors in 2.4.0 beta

Ok sorry, but I persist on 2 points :
1/ It's not a good idea to change the code of running modules for a BETA version
2/ It's time to adopt a definitive editor

chco2

Module Developer
Posted on: 2009/8/28 13:01
chco2
chco2 (Show more)
Module Developer
Posts: 374
Since: 2004/3/5 1
#6

Re: Editors in 2.4.0 beta

Hi thanks for the tips!
And if I'm reading this correct.. you will have to be changing this code if it is a beta or not, right? Since a new full release will be called 2.4 anyhows.

trabis

Core Developer
Posted on: 2009/8/28 13:08
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#7

Re: Editors in 2.4.0 beta

Sure. You(or module dev) will have to make changes to any module that looks for XOOPS 2.3.x instead of XOOPS 2.3 or greater(2.4, 2.5, 2.6, etc).

hervet

Friend of XOOPS
Posted on: 2009/8/28 13:14
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#8

Re: Editors in 2.4.0 beta

I'll change it in the opposite way, XOOPS 2.0.x will be tested and if it's not this version, it will be used in the >= 2.3 way.

trabis

Core Developer
Posted on: 2009/8/28 13:32
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#9

Re: Editors in 2.4.0 beta

Quote:

hervet wrote:
Ok sorry, but I persist on 2 points :
1/ It's not a good idea to change the code of running modules for a BETA version
2/ It's time to adopt a definitive editor


Thanks hervet,
As for point 1, I believe we're are doing this for test only. You should not be using XOOPS 2.4 beta for a start.

As for point 2 I'm open for discussion. Personally I'm fine with xoopseditor alone (dhtml).

hervet

Friend of XOOPS
Posted on: 2009/8/28 13:38
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#10

Re: Editors in 2.4.0 beta

Most of the sites content is maintained by non technician people so they need a WYSIWYG editor with images uploading features.

The question is which one to adopt, may be it's interesting to see what other projects have done (Wordpress for example), what editors projects are alive still a long time and maintained.

Personnaly I vote for Tiny MCE.