1
maotouying
HTML Editor
  • 2008/10/22 14:44

  • maotouying

  • Just popping in

  • Posts: 4

  • Since: 2006/4/7 1


I have a new installed XOOPS 2.30 with
- Community Pack 2.0
- News 1.56
- CBB 3.08
- XOOPS_FRAMEWORKS_XOOPSEDITOR_VERSION", "1.10"
I am very happy with the configuration and XOOPs.

However, for some reasons I cannot get other Editors to work but DHTML. The 'Select' pull-down menu like the one you have on this page does not appear.
I have tried to follow http://mark.boyden.name/smartsection.item.16/editors-wysiwyg.html ,- but I am confused by the number of versions involved.
I am afraid, I have missed something very fundamental, because noone else seem to have this problem

2
GPboarder
Re: HTML Editor
  • 2008/10/22 15:19

  • GPboarder

  • Friend of XOOPS

  • Posts: 248

  • Since: 2006/10/6


I had a quick look at the article you cited and think you might have become too involved. The editors are a part of 2.3.1 so there is nothing to do but install.

I have new installation as well as updated site with all editor options available. I did nothing but follow the install instructions.

Try a re-upload of the files and if that doesn't do it for you, remember to include the information from this post so the experts can chip in.
Optimism is the mother of disappointment.

3
JohnDoo
Re: HTML Editor
  • 2008/10/22 19:24

  • JohnDoo

  • Just popping in

  • Posts: 14

  • Since: 2003/9/30


Maybe it's the same problem I had. Check the content of xoops_data/caches/xoops_cache/xoops_editorlist.php file. If you have an empty array then try modifying class/xoopseditor.php, just after xoops_load("XoopsLists"):

xoops_load("XoopsLists");
   
/** ADD-BEGIN */
   
$this->root_path XOOPS_ROOT_PATH."/class/xoopseditor";
   
/** ADD-END */
   
$_list XoopsLists::getDirListAsArray($this->root_path.'/');


It worked in my xoops.

I don't know why but in my XOOPS 2.3.1, at the moment of calling getDirListAsArray, the value of $this->root_path was the real root dir from my server instead of root path from xoopseditor classes. I've tested on two different platforms (clean install and upgraded from 2.0.18) with the same behaviour.

XOOPS Version - XOOPS 2.3.1
PHP Version - 5.1.6
MySQL Version - 5.0.22
Server API Version - apache2handler
OS Version - Linux

4
maotouying
Re: HTML Editor
  • 2008/10/23 10:16

  • maotouying

  • Just popping in

  • Posts: 4

  • Since: 2006/4/7 1


Thanks for your quick replies. See this is what I know about my system :
OS: Linux xxxxxxxxx 2.6.9-023stab046.2-enterprise #1 SMP Mon Dec 10 15:22:33 MSK 2007 i686
PHP: 5.1.2c
MySQL: 5.0.18
XOOPS: XOOPS 2.3.1 (I have upgraded from 2.3.0)

I can see no errors in XOOPS, PHP or MySQL debug mode(s)

The editors in the /root/class/xoopseditor are :
dhtmltextarea
fckeditor
koivi
textarea
tinymce

The editor choices in the News Preferences pull-down-menu are
DHTML
Compact
Spaw Editor
HtmlArea Editor
Koivi Editor
FCK Editor
TinyEditor

I have tried the quick fix you offered, however bad luck

Does this ring bells ?

Thanks for your help ...

5
JohnDoo
Re: HTML Editor
  • 2008/10/23 10:52

  • JohnDoo

  • Just popping in

  • Posts: 14

  • Since: 2003/9/30


With news module you have to modify 2 files:

/modules/news/xoops_version.php

/*** Editor to use */
/** Comment the old defines
$modversion['config'][20]['name'] = 'form_options';
$modversion['config'][20]['title'] = "_MI_NEWS_FORM_OPTIONS";
$modversion['config'][20]['description'] = '_MI_NEWS_FORM_OPTIONS_DESC';
$modversion['config'][20]['formtype'] = 'select';
$modversion['config'][20]['valuetype'] = 'text';
$modversion['config'][20]['options'] = array(
_MI_NEWS_FORM_DHTML=>'dhtml',
_MI_NEWS_FORM_COMPACT=>'textarea',
_MI_NEWS_FORM_SPAW=>'spaw',
_MI_NEWS_FORM_HTMLAREA=>'htmlarea',
_MI_NEWS_FORM_KOIVI=>'koivi',
_MI_NEWS_FORM_FCK=>'fck',
_MI_NEWS_FORM_TINYEDITOR=>'tinyeditor'
);
$modversion['config'][20]['default'] = 'dhtml';
*/
 
/*** Editor to use (Xoops 2.3) */
$modversion['config'][20]['name'] = 'form_options';
$modversion['config'][20]['title'] = "_MI_NEWS_FORM_OPTIONS";
$modversion['config'][20]['description'] = '_MI_NEWS_FORM_OPTIONS_DESC';
$modversion['config'][20]['formtype'] = 'select';
$modversion['config'][20]['valuetype'] = 'text';
xoops_load('xoopsEditorHandler');
$modversion['config'][20]['options'] = array_flip(xoopsEditorHandler::getList());
$modversion['config'][20]['default'] = 'dhtmltextarea';


/modules/news/include/functions.php:

/** Comment the old news_getWysiwygForm function
function &news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental='')
{
...
}
 */
/**
 * Retreive an editor according to the module's option "form_options"
 */
function &news_getWysiwygForm($caption$name$value ''$rows 35$cols 60$supplemental='')
{
    
$editor_configs = array();
    
$editor_configs['name'] = $name;
    
$editor_configs['value'] = $value;
    
$editor_configs['rows'] = $rows $rows 35;
    
$editor_configs['cols'] = $cols $cols 60;
    
$editor_configs['width'] = "100%";
    
$editor_configs['height'] = "400px";

    
$editor = new XoopsFormEditor($captionnews_getmoduleoption('form_options'), $editor_configs);
    return 
$editor;
}


And finally go to system modules administration and update news module. Then you should see the right list of editors at news module preferences.

6
maotouying
Re: HTML Editor
  • 2008/10/23 15:50

  • maotouying

  • Just popping in

  • Posts: 4

  • Since: 2006/4/7 1


See this is what I did and XOOPS didn't restart any more :


/**
* Retreive an editor according to the module's option "form_options"
*/

/** Comment the old news_getWysiwygForm function
* function &news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental='')
* {
* $editor = false;
* $x22=false;
* $xv=str_replace('XOOPS ','',XOOPS_VERSION);
* if(substr($xv,2,1)=='2') {
* $x22=true;
* }
*
* $editor_configs=array();
* $editor_configs['name'] =$name;
* $editor_configs['value'] = $value;
* $editor_configs['rows'] = 35;
* $editor_configs['cols'] = 60;
* $editor_configs['width'] = '100%';
* $editor_configs['height'] = '400px';
*/
function &news_getWysiwygForm($caption, $name, $value = '', $rows = 35, $cols = 60, $supplemental='')
{
$editor_configs = array();
$editor_configs['name'] = $name;
$editor_configs['value'] = $value;
$editor_configs['rows'] = $rows ? $rows : 35;
$editor_configs['cols'] = $cols ? $cols : 60;
$editor_configs['width'] = "100%";
$editor_configs['height'] = "400px";

$editor = new XoopsFormEditor($caption, news_getmoduleoption('form_options'), $editor_configs);
return $editor;
}

7
JohnDoo
Re: HTML Editor
  • 2008/10/23 16:45

  • JohnDoo

  • Just popping in

  • Posts: 14

  • Since: 2003/9/30


Dou you mean blank page? Any errors in debug mode? Did you change the modules/news/xoops_version.php file too? I'd try adding echo "bla bla bla"; lines at different parts of xoops_version.php and functions.php, for example at the beginning of news_getWysiwygForm, ...
Just to check where is the problem.

8
ghia
Re: HTML Editor
  • 2008/10/23 18:42

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I managed to run Koivi with these fixes.

9
maotouying
Re: HTML Editor
  • 2008/10/24 7:54

  • maotouying

  • Just popping in

  • Posts: 4

  • Since: 2006/4/7 1


Thanks for all your time and your help, I really appreciate your assistance, however, I am afraid, that the hacks offered are a little bit too much for my skills. I will rather wait for some official patches or updates, which are hopefully consistent allover the XOOPS-modules and -packages.

Take care ...

10
piar
Re: HTML Editor
  • 2008/10/30 14:50

  • piar

  • Just popping in

  • Posts: 22

  • Since: 2008/10/30


I done it as JohnDoo wrote. Now WYSIWYG editors (TinyMCE and FCKEditor) works okey in News module but there is one exception. When submitting new article using one of that editors I get message: 'Please enter The Scoop' despite I entered it.
This is the part of responsible code:
if ( myform.hometext.value == "" ) { window.alert("Please enter The Scoop"); myform.hometext.focus(); return false; }

And also when I put Scoop using DHTML, and then swich to TinyMCE, chagnes done to Scoop aren't saved to DB whereas chagnes done to Extended Text are saved...

Is there some solution for this problem?

Regards

Login

Who's Online

408 user(s) are online (300 user(s) are browsing Support Forums)


Members: 1


Guests: 407


xoopdio,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits