Re: Feature additions to DB_DataObject_FormBuilder
| From: | Mocsnik Norbert | Date: | Tue, 02 Dec 2003 00:18:39 +0000 |
| Subject: | Re: Feature additions to DB_DataObject_FormBuilder | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24033@lists.php.net to get a copy of this message | ||
I've uploaded the file to http://www.e-ceg.hu/FormBuilder.txt
Mocsnik Norbert wrote:
I made something similar and I wanted to post it to the list at the end of this week. What I made is: a) added "fieldsToRender" configuration option// a field will only be rendered if: // 1. it is a primary key // 2. it's explicitly requested in $do->fieldsToRender arrayb) added "userEditableFields" configuration option// $do->userEditableFields may contain some field names; // the other fields will be automatically freeze()-d; // this functionality is ignored if $do->userEditableFields is not set (backward compatibility)c) added "forced_values" configuration option// useful if you want to set some fields internally before processForm() (e.g. storing user id in the "userid" field) $do->forced_values = array( 'owner_user' => $logged_in_user ); [...] $form->process(array(&$fg,'processForm'), true); d) table lookups: insert an additional empty option (value="") as the first element of the <select> listbox // $do->select_add_empty = true;Justin, is your solution really similar to this, or are you talking about table links (which fields to show in the <select> element and so on)? I've attached the modified file. Search for the string 'QLZ' and you'll find my improvements. Let me know your thoughts. Justin Patrin wrote:The altered file is attached. The ini file changed is the databasename.ini file. It has no alterations, only additions. There are two new sections. [tablename__display_fields] 0 = column1 1 = column2 ... There can be any number of display fields. For lack of a better way to do it, I used numbers starting at 0. This sets the order of the displayed column data. The fields are comma separated (could be configurable). [tablename__order_fields] 0 = column1 [ASC|DESC] 1 = columns [ASC|DESC] ... Basically the same as the __display_fields entries except that you can include any valud order statement. You could even do: 0 = column1, column2 DESC Arnaud Limbourg wrote:Hi, sounds good ! Sent the code here i'm sure markus (the maintainer) will have a look at it ;) Arnaud.I've made some additions to DB_DataObject_FormBuilder that involve some additions to the DB_DataObject ini files. Namely, support for multiple sort and display columns, configured per table in the ini file. I'm not sure that the code I wrote is entirely in the correct place, but I don't know who to ask about it. Anyone want to point me in the right direction? -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php