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

Bug #1126 addImage does not work
Submitted: 2004-04-03 18:52 UTC Modified: 2004-05-28 01:20 UTC
From: callmeobass at yahoo dot com Assigned: danielc
Status: Closed Package: HTML_Form
PHP Version: 4.3.4 OS: Fedora Core 1, GNU/Linux
Roadmaps: (Not assigned)    

 [2004-04-03 18:52 UTC] callmeobass at yahoo dot com
Description: ------------ There seems to be not be an 'displayImageRow' or 'displayImage' functions, so any calls to 'addImage' fail. My ./configure line (as reported by the phpinfo function): './configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs2=/usr/sbin/apxs' Reproduce code: --------------- <?php $form =& new HTML_Form( '/handle-form.php', 'post', 'myForm' ); $form->addImage( 'img', '/img.php' ); $form->addSubmit( 'submitButton', 'Submit!' ); $form->display(); ?> Expected result: ---------------- Something similar to: <form action="/handle-form.php" method="post" name="myForm"> <table> <tr> <th align="right"><input type="image" src="/img.php" /></th> <td> </td> </tr> <tr> <th align="right"> </th> <td><input type="submit" name="submitButton" value="Submit!" /> </table> </form> Actual result: -------------- <b>Fatal error</b>: Call to undefined function: displayimagerow() in <b>/usr/share/pear/HTML/Form.php(872) : eval()'d code</b> on line <b>1</b><br />


 [2004-04-10 03:02 UTC] webmaster at gb404 dot com
Hello, Precisly, 4 functions are missing : Here's the missing functions, coded following you're (i mean the maintainer) coding standards : // }}} // {{{ displayImage() function displayImage($name, $src) { print "<img name=\"$name\" src=\"$src\" />"; } // }}} // {{{ displayImageRow() function displayImageRow($name, $src) { print " <tr>\n"; print " <td>"; $this->displayImage($name, $src); print " </td>\n"; print " </tr>\n"; } // }}} // {{{ returnImage() function returnImage($name, $src) { return "<img name=\"$name\" src=\"$src\" />"; } // }}} // {{{ returnImageRow() function returnImageRow($name, $src) { $str = " <tr>\n"; $str .= " <td>"; $str .= $this->returnImage($name, $src); $str .= " </td>\n"; $str .= " </tr>\n"; return $str; } You can now perform an easy update of the package. Gregory
 [2004-05-28 01:20 UTC] danielc
Fixed in CVS.