[Phpmyadmin-devel] Multicolumn sorting feature request. Help needed.

Sastry aditya ganeshaditya1 at gmail.com
Sat Mar 15 17:57:23 CET 2014


Hi all,

I tried to refrain from asking help as much as I can, but now I am almost
done with this feature request and I figure I need to re-factor a large
portion of the code and it would be safe if I ascertain the purpose of some
specific chunks of the code written so that I don't break anything while
re-factoring.

I sincerely wish the people reading this mail not to think of this asking
for help mail as my inability to resolve problems by myself.

This is the farthest I got
http://adityasastry.in/multicolumn.jpg(Screenshot functionality is not
working in Ubuntu for some reason, so I
had to manually take a photo from my phone of the screen and upload it).

As you can see the arrows are not pointing in the correct direction also
the url's attached to those arrows don't work yet. For these problems to
resolve I figure I had to re-factor getOrderLinkAndSortedHeaderHtml()
function. This function accepts columns one at a time and checks with the
isInSorted() function to ascertain if it is a sorted column in that case it
stops the execution there itself and constructs the target url. I have
rewritten the isInSorted() function and getSortingUrlParams() function to
work with multiple columns and now I need to refactor this function to work
with multiple columns.

While refactoring I had a couple of doubts.

(A) What is the difference between $fields_meta->orgname and
$fields_meta->name ?

(B) What purpose does this chunk of code in
getOrderLinkAndSortedHeaderHtml() between lines 1900 and 1920 serve ?

 if (preg_match(
            '@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|'
            . 'LOCK IN SHARE MODE))@is',
            $unsorted_sql_query, $regs3
        )) {
            $sorted_sql_query = $regs3[1] . $sort_order . $regs3[2];
        } else {
            $sorted_sql_query = $unsorted_sql_query . $sort_order;
        }

(C) There is some direction parameter used in most of the code in this file
which takes two values horizontal and vertical.
What does this parameter stand for ? What semantic sense do these
parameters horizontal and vertical make ?

$direction == self::DISP_DIR_HORIZONTAL_FLIPPED

Regards,
Aditya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20140315/436f6b48/attachment.html>


More information about the Developers mailing list