Integrate QuickForm with SPAW (advanced "textarea" type) ?
| From: | Tommy Ipsen | Date: | Fri, 04 Jul 2003 13:49:59 +0000 |
| Subject: | Integrate QuickForm with SPAW (advanced "textarea" type) ? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6472@lists.php.net to get a copy of this message | ||
Hi
I'm using QuickForm as well as an editor called SPAW for an online CMS system. I would like to integrate the two if possible!
Now I'm doing something like this to use SPAW:
//$spaw_root = $_SERVER['DOCUMENT_ROOT'].'/spaw/'; //windows $spaw_root = $basedir.'/spaw/'; //linux// include the control file require_once($spaw_root.'spaw_control.class.php'); // create instance of the spaw editor (advanced form-element!) $sw = new SPAW_Wysiwyg(
'description' /*name*/,
$projectdescription /*value*/,
'dk' /*language*/,
'sidetable' /*toolbar mode*/,
'default' /*theme*/,
'100%' /*width*/,
'500px' /*height*/
);
// return html-code for spaw-object
echo $sw->getHTML();
This is my present code for creating the form using QuickForm:
//generer formular
$form = new HTML_QuickFormExtended('editmenu', 'POST');
$form->addHeader('Rediger menupunkt');
$form->addElement('hidden', 'cid', $cid);
$form->addElement('hidden', 'id', '');
$form->addElement('text', 'priority', 'Prioritet:', array('class' => 'stdinput'));
$form->addElement('text', 'title', 'Titel:', array('class' => 'stdinput'));
$form->addElement('select', 'status', 'Projektstatus:', $contentarray);
$form->addElement('html', '<td width="10%" class="nowrap">Description:</td>
<td width="90%">'.$sw->getHTML().'</td>');
...blablaWhen using this method I can't use QuickForms internal functions on the SPAW editor object - neither can I use the rules for that object! Would it be possible for me to somehow integrate the SPAW editor with QuickForm so I might use it like this: $spawoptions = array(
'value' => $projectdescription,
'language' => 'dk',
'toolbarmode' => 'sidetable',
'theme' => 'default',
'width' => '100%',
'height' => '500px'
}
$form->addElement('spaw', 'description', 'Titel:', $spawoptions);
I'm thinking of somehow extending the addElement method perhaps?
Hope someone has good ideas or advice :-)
Read more about the spaw-editor: http://www.solmetra.com/en/disp.php/en_products/en_spaw/en_spaw_about
Regards,
Tommy Ipsen