xoops forums

hervet

Friend of XOOPS
Posted on: 2005/2/3 16:37
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#1

[mini guide] How to quickly replace all the textarea with kiovi in Xoops

Hi,

First, this is just an exercice and a hack , don't use it on a production website until you have completly and fully tested id !

The goal is to replace all the XOOPS dhtml textareas (input boxes), like the one you can see when you create a custom block, with Kiovi.

Begin with the kiovi's installation. Please report to the text file named readme.txt inside the kiovi's archive to know how to do it.

Once it's done, edit the file /xoops/class/wysiwyg/formwysiwygtextarea.php and rename the function render() with _render(), so you must have :
Quote:

function _render()

I have just added the underscore character at the first position of the name.

After this, edit the file named /xoops/class/xoopsform/formdhtmltextarea.php

After this line,
Quote:

include_once XOOPS_ROOT_PATH."/class/xoopsform/formtextarea.php";

add this new one :
Quote:

include_once XOOPS_ROOT_PATH."/class/wysiwyg/formwysiwygtextarea.php";


Then, replace the line :
Quote:

class XoopsFormDhtmlTextArea extends XoopsFormTextArea

with :
Quote:

class XoopsFormDhtmlTextArea extends XoopsFormWysiwygTextArea


replace all the content of the function named XoopsFormDhtmlTextArea with :
Quote:

function XoopsFormDhtmlTextArea($caption, $name, $value, $rows='100%', $cols='400px', $hiddentext="xoopsHiddenText")
{
$this->XoopsFormWysiwygTextArea($caption, $name, $value, $rows, $cols,'',$skin="default");
}


and replace the function render() with :
Quote:

function render()
{
return $this->_render();
}

That's all !

If someone have the time, you can do the same with the class XoopsFormTextArea contained in the file formtextarea.php

Bye,
Herve

irmtfan

Module Developer
Posted on: 2005/2/3 17:22
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#2

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

i do this but have a fatal error:
Fatal error: Class xoopsformdhtmltextareaCannot inherit from undefined class xoopsformwysiwygtextarea in /.../.../public_html/test/class/xoopsform/formdhtmltextarea.php on line 56

do i wrong somthing?
many thanks for share it.this hack is very amazing

hervet

Friend of XOOPS
Posted on: 2005/2/3 17:31
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#3

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

that's because I have forgotted one thing.
In the file called formdhtmltextarea.php, just after this line :
Quote:

include_once XOOPS_ROOT_PATH."/class/xoopsform/formtextarea.php";

add this one :
Quote:

include_once XOOPS_ROOT_PATH."/class/wysiwyg/formwysiwygtextarea.php";


Sorry for my error.
I have edited and corrected my first post.

Bye,
Hervé

irmtfan

Module Developer
Posted on: 2005/2/3 17:39
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#4

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

aha,
works now.
thanks*1000 hervet you're rock

LazyBadger

Home away from home
Posted on: 2005/2/3 18:55
LazyBadger
LazyBadger (Show more)
Home away from home
Posts: 1187
Since: 2004/6/7 9
#5

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

Tested OK, and modified files combined into one package.
Site-Admins, which want to use it, must also remember - Koivi kill automatic redirects for FireFox visitors

irmtfan

Module Developer
Posted on: 2005/2/3 19:10
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#6

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

do you read this in the document of koivi editor:
Quote:
Solve Redirect Problem under Gecko Browsers

This patch was made by FrankBlack (thx for your support)

The malfunction of redirecting pages is a bug within Gecko-based browsers. Here a solution to prevent this:


Open system_redirect.html and change the line with body-tag to:


<body onload="void(location.href='<{$url}>');">

Open file xoopsroot/include/functions.php and look for function redirect_header. The line with the body-tag have to look like this:

<body onload="void(location.href=\''.$url.'\');">

tzvook

Just can't stay away
Posted on: 2005/2/3 19:15
tzvook
tzvook (Show more)
Just can't stay away
Posts: 875
Since: 2003/2/1 2
#7

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

Hello
Sorry to say that, but every time I see someone mention the Koivi editor I try yo see if it changed, and , well, it's way behind SPAW or HTMLAREA !!!

Why going to that direction?
one who used to htmlarea wouldn't come close to Koivi!!!
Is there something I'm missing ?

hervet

Friend of XOOPS
Posted on: 2005/2/3 19:40
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#8

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

Kiovi is an excellent editor and above all, it runs with much more browsers than the others, even if I really like Spaw.

tzvook

Just can't stay away
Posted on: 2005/2/3 19:53
tzvook
tzvook (Show more)
Just can't stay away
Posts: 875
Since: 2003/2/1 2
#9

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

Well, I found it very buggy, image management is very bad and less friendly to end user.
Yep SPAW is not bad but is not enough feature rich...

LazyBadger

Home away from home
Posted on: 2005/2/3 20:45
LazyBadger
LazyBadger (Show more)
Home away from home
Posts: 1187
Since: 2004/6/7 9
#10

Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops

Quote:

tzvook wrote:
one who used to htmlarea wouldn't come close to Koivi!!!
Is there something I'm missing ?

HTMLArea is sloooow!