[Phpmyadmin-devel] Refactoring insert-edit

Marc Delisle marc at infomarc.info
Wed May 16 14:45:00 CEST 2012


Le 2012-05-16 08:37, Thilina Buddika Abeyrathna a écrit :
> On Mon, May 14, 2012 at 10:23 PM, Thilina Buddika Abeyrathna <
> thilinaabeyrathna at gmail.com> wrote:
> 
>>
>>
>> On Mon, May 14, 2012 at 10:09 PM, Marc Delisle <marc at infomarc.info> wrote:
>>
>>> Le 2012-05-14 08:50, Thilina Buddika Abeyrathna a écrit :
>>>> Hi Marc,
>>>> There are HTML code block from line 438 in the tbl_change.php
>>> file(after my
>>>> last commit [0]).  It doesn't mix with much PHP tags. It is somewhat
>>>> readable.
>>>> Do I need to implement several functions to render this HTML block. Can
>>> you
>>>> give me a suggestion..
>>>>
>>>> [0] -
>>>>
>>> https://github.com/thilinaa/phpmyadmin/commit/9d6c38daf6a98d915a34391bddb987b116be98c0
>>>
>>> Hi Thilina,
>>> The code generating the actions_panel fieldset would benefit from being
>>> refactored into one or more functions. The reason is that it's difficult
>>> to understand quickly such a long code block.
>>>
>>> It could become
>>> $html_output = PMA_getActionsPanel(...);
>>>
>>> Thank you for your reply Marc. I'll do like this
>>
>>
>>> -----------
>>>
>>> By the way, did you consider using a class? Have a look at
>>> libraries/Partition.class.php. Then, the calling script uses this syntax:
>>>
>>> $partition_names = PMA_Partition::getPartitionNames($db, $table);
>>>
>>> The benefit is that you don't have to bother about function name clashing.
>>>
>>> Thanks Marc. I'll look at that.
>>
> 
> Hi Marc,
> Now tbl_change.php script is somewhat readable and maintainable. Still
> there is a long if condition in this script. but it is not a very complex
> control statement . So do I need to implement a function to separate that
> if condition too.

Ok. Don't forget this bug, when following this scenario:

1. Browse a table
2. Click the checkbox for two rows
3. At the botton, click the With selected...change link

-- 
Marc Delisle
http://infomarc.info

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: OpenPGP digital signature
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20120516/2ef41cf5/attachment.sig>


More information about the Developers mailing list