Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.6

Request #6036 interface to add further Quickform-Elements
Submitted: 2005-11-22 18:23 UTC
From: arne dot bippes at brandao dot de Assigned: wiesemann
Status: Closed Package: DB_Table
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-22 18:23 UTC] arne dot bippes at brandao dot de
Description: ------------ Currently QuickForm::getElement() creates unknown Elements with a standard parameter set. There is no possibilty to add custom QuickForm-Elements which needs further parameters. Therefore an interface to add custom HTML_QuickForm::createElement()-calls is needed. A solution might be to just define a qf_type (e.g. function) which instances a class and calls a defined function which is returning an $element. The following easy code does everything i need and is working for me (see test-script) Test script: --------------- #### in the case-statement of QuickForm::getElement() ### case 'static': .... break; /** START NEW CODE */ case 'function': if ( class_exists($col['qf_class']) && is_callable(array($col['qf_class'],'getElement') )) { $qf_class =& new $col['qf_class']; $element =& $qf_class->getElement($col,$elemname,$setval); break; } /** END NEW CODE */ default: .... #### the column definition #### $col ...: 'email_an' => array( 'type' => 'varchar', 'qf_type' => 'function', 'qf_class' => 'Bdo_advinput', 'qf_advlabel' => '(z.B. empfaenger@t-systems.com)', 'qf_label' => _('E-Mail Adresse des Empfaengers'), ), ### the class where the getElement()-Method is called ### class Bdo_advinput { function getElement(&$col, &$elemname, &$setval) { $element =& HTML_QuickForm::createElement( 'advinput', $elemname, $col['qf_label'], $col['qf_advlabel'], (isset($setval) ? $setval : '') ); return $element; } }

Comments

 [2005-11-22 21:20 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-11-23 16:14 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-11-23 17:23 UTC] arne dot bippes at brandao dot de
Works perfectly. Thanks!