On Sun, May 29, 2011 at 4:31 PM, Marc Delisle marc@infomarc.info wrote:
Le 2011-05-29 03:11, Ammar Yasir a écrit :
Ammar, it's OK to have two components but please refactor common code into functions and put them in a new libraries/tbl_select.lib.php that will be called from both components; otherwise it will be difficult to
maintain.
An example of needed refactoring: the "Gets the list and number of fields" section.
I did refactoring in two areas:
- As you proposed, Getting the list and number of fields.
- The where clause generation in the query-building part.
Should we also do for the HTML part? Some part of that (for example the foreign keys display part) is common but also has HTML content embedded. Apart from that since the zoom-search form takes the field as input so
rest
of the form is based on that constraint. So I was thinking that the HTML part can stay as it is.
Ammar,
The foreign keys display part is a good example of needed refactoring.
I don't know how much HTML refactoring you are willing to do, but some HTML is easy to refactor, for example:
- the section that sets $titles['Browse']
- the beginning of the table with headers Column, Type, etc
Parts refactored are: - Setting titles (titles['Browse']]) - getting fields list (getting column details) - setting sub-tabs (Table search and Zoom search) - setting table header of QBE display - displaying foreign data - search criteria input elements (HTML content generation for the input elements)
In libraries/tbl_select.lib.php, please describe for each function the parameters and return values; see an example in libraries/server_synchronize.lib.php.
About the syntax, please use spaces around operators. Instead of $i-1 use $i - 1
There is a case of undefined variable. To reproduce, on sakila.actor, Search, Table search, last name Wilson, Go:
Notice in ./libraries/tbl_select.lib.php#129 Undefined variable: w
Backtrace
./tbl_select.php#329: PMA_tbl_search_getWhereClause( string , string last_update, string timestamp, string , string =, boolean , )
-- Marc Delisle http://infomarc.info
vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel